跳到主要内容

二进制文件

提示

请查看手动安装,了解如何搭建你的 Python/Ansible/Systemd 环境!

从发布页面下载适用于你平台的 *.tar.gz。解压后使用以下命令设置 Semaphore:

wget https://github.com/semaphoreui/semaphore/releases/download/v2.17.15/semaphore_2.17.15_linux_amd64.tar.gz

tar xf semaphore_2.17.15_linux_amd64.tar.gz

./semaphore setup

现在可以运行 Semaphore 了:

./semaphore server --config=./config.json

Semaphore 将可通过以下 URL 访问:https://localhost:3000。


作为服务运行​

更详细的信息 — 请查看扩展的 Systemd 服务文档。

如果你是通过包管理器或下载二进制文件安装的 Semaphore,则需要手动创建 Semaphore 服务。

创建 systemd 服务文件:

将 /path/to/semaphore 和 /path/to/config.json 替换为你的 semaphore 和配置文件的路径。

sudo 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=/path/to/semaphore server --config=/path/to/config.json
SyslogIdentifier=semaphore
Restart=always
RestartSec=10s

[Install]
WantedBy=multi-user.target
EOF

启动 Semaphore 服务:

sudo systemctl daemon-reload
sudo systemctl start semaphore

检查 Semaphore 服务状态:

sudo systemctl status semaphore

设置 Semaphore 服务开机自启:

sudo systemctl enable semaphore