58 lines
1.2 KiB
Bash
58 lines
1.2 KiB
Bash
|
#!/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 <<EOF
|
||
|
[Unit]
|
||
|
Description=Semaphore Ansible
|
||
|
Documentation=https://github.com/semaphoreui/semaphore
|
||
|
Wants=network-online.target
|
||
|
After=network-online.target
|
||
|
|
||
|
[Service]
|
||
|
Type=simple
|
||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||
|
ExecStart=/usr/bin/semaphore server --config=/etc/semaphore/config.json
|
||
|
SyslogIdentifier=semaphore
|
||
|
Restart=always
|
||
|
RestartSec=10s
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|
||
|
EOF
|
||
|
|
||
|
systemctl daemon-reload
|
||
|
|
||
|
firewall-cmd --add-port=3000/tcp --permanent
|
||
|
firewall-cmd --reload
|