From a047599fc859113377ed4553926e4f71a44e2c83 Mon Sep 17 00:00:00 2001 From: Eliezer Croitoru Date: Sun, 1 Sep 2024 03:13:03 +0300 Subject: [PATCH] Added basic semaphore scripts --- create-semaphore-db.sql | 23 +++++++++++++++++ install-semaphore.sh | 57 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 create-semaphore-db.sql create mode 100644 install-semaphore.sh diff --git a/create-semaphore-db.sql b/create-semaphore-db.sql new file mode 100644 index 0000000..aaeeef4 --- /dev/null +++ b/create-semaphore-db.sql @@ -0,0 +1,23 @@ +CREATE DATABASE semaphore; +CREATE USER 'semaphore'@'localhost' IDENTIFIED BY 'semaphore'; +GRANT Usage ON *.* TO 'semaphore'@'localhost'; +GRANT Alter ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create view ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Delete ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Delete history ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Drop ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Index ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Insert ON semaphore.* TO 'semaphore'@'localhost'; +GRANT References ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Select ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Show view ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Trigger ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Update ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Alter routine ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create routine ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Create temporary tables ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Execute ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Lock tables ON semaphore.* TO 'semaphore'@'localhost'; +GRANT Show Create Routine ON semaphore.* TO 'semaphore'@'localhost'; + diff --git a/install-semaphore.sh b/install-semaphore.sh new file mode 100644 index 0000000..317d7ed --- /dev/null +++ b/install-semaphore.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +dnf install -y jq + +RPM_URL="https://github.com/semaphoreui/semaphore/releases/download/v2.10.22/semaphore_2.10.22_linux_amd64.rpm" +OUTPUT_FILENAME="semaphore_2.10.22_linux_amd64.rpm" + + +wget "${RPM_URL}" -O "${OUTPUT_FILENAME}" + +dnf localinstall -y ./semaphore*amd64.rpm + +dnf module disable mariadb -y + +wget "https://downloads.mariadb.com/MariaDB/mariadb_repo_setup" -O "mariadb_repo_setup" +# Checksum check +bash "mariadb_repo_setup" + +dnf install mariadb-server -y + +systemctl start mariadb +systemctl enable mariadb + +## Create database and user + +## setup semaphore + +## install config + +mkdir -p /etc/semaphore +cp -vf config.json /etc/semaphore/ + +##Create service + +cat > /etc/systemd/system/semaphore.service <