Add systemd unit files to the RPM/DEB packages (#3986)

* add systemd unit file for server (`woodpecker-server.service`)
* add systemd unit file for agent (`woodpecker-agent.service`)
* add systemd unit files to nfpm package definitions
* add etc config file examples

fixes #1575
This commit is contained in:
Johannes Kastl 2024-08-25 22:28:42 +02:00 committed by GitHub
parent 0b34578923
commit 8768eb2a2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 60 additions and 0 deletions

View file

@ -10,3 +10,7 @@ section: daemon/system
contents: contents:
- src: ./dist/agent/linux_amd64/woodpecker-agent - src: ./dist/agent/linux_amd64/woodpecker-agent
dst: /usr/local/bin/woodpecker-agent dst: /usr/local/bin/woodpecker-agent
- src: ./woodpecker-agent.service
dst: /usr/local/lib/systemd/system/
- src: ./woodpecker-agent.env.example
dst: /etc/woodpecker/

View file

@ -10,3 +10,7 @@ section: daemon/system
contents: contents:
- src: ./dist/server/linux_amd64/woodpecker-server - src: ./dist/server/linux_amd64/woodpecker-server
dst: /usr/local/bin/woodpecker-server dst: /usr/local/bin/woodpecker-server
- src: ./woodpecker-server.service
dst: /usr/local/lib/systemd/system/
- src: ./woodpecker-server.env.example
dst: /etc/woodpecker/

View file

@ -0,0 +1,7 @@
# Example for a woodpecker-agent.env file
# Check the documentation for the agent:
# https://woodpecker-ci.org/docs/administration/agent-config
# Add all required environment variables for your setup in the form of VARIABE=value
VARIABLE=value

View file

@ -0,0 +1,19 @@
[Unit]
Description=WoodpeckerCI agent
Documentation=https://woodpecker-ci.org/docs/administration/agent-config
Requires=network.target
After=network.target
ConditionFileNotEmpty=/etc/woodpecker/woodpecker-agent.env
ConditionPathExists=/etc/woodpecker/woodpecker-agent.env
[Service]
Type=simple
EnvironmentFile=/etc/woodpecker/woodpecker-agent.env
User=woodpecker
Group=woodpecker
ExecStart=/usr/local/bin/woodpecker-agent
WorkingDirectory=/var/lib/woodpecker/
StateDirectory=woodpecker
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,7 @@
# Example for a woodpecker-server.env file
# Check the documentation for the server:
# https://woodpecker-ci.org/docs/administration/server-config
# Add all required environment variables for your setup in the form of VARIABE=value
VARIABLE=value

View file

@ -0,0 +1,19 @@
[Unit]
Description=WoodpeckerCI server
Documentation=https://woodpecker-ci.org/docs/administration/server-config
Requires=network.target
After=network.target
ConditionFileNotEmpty=/etc/woodpecker/woodpecker-server.env
ConditionPathExists=/etc/woodpecker/woodpecker-server.env
[Service]
Type=simple
EnvironmentFile=/etc/woodpecker/woodpecker-server.env
User=woodpecker
Group=woodpecker
ExecStart=/usr/local/bin/woodpecker-server
WorkingDirectory=/var/lib/woodpecker/
StateDirectory=woodpecker
[Install]
WantedBy=multi-user.target