mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 11:21:02 +00:00
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:
parent
0b34578923
commit
8768eb2a2b
6 changed files with 60 additions and 0 deletions
|
@ -10,3 +10,7 @@ section: daemon/system
|
|||
contents:
|
||||
- src: ./dist/agent/linux_amd64/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/
|
||||
|
|
|
@ -10,3 +10,7 @@ section: daemon/system
|
|||
contents:
|
||||
- src: ./dist/server/linux_amd64/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/
|
||||
|
|
7
nfpm/woodpecker-agent.env.example
Normal file
7
nfpm/woodpecker-agent.env.example
Normal 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
|
19
nfpm/woodpecker-agent.service
Normal file
19
nfpm/woodpecker-agent.service
Normal 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
|
7
nfpm/woodpecker-server.env.example
Normal file
7
nfpm/woodpecker-server.env.example
Normal 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
|
19
nfpm/woodpecker-server.service
Normal file
19
nfpm/woodpecker-server.service
Normal 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
|
Loading…
Reference in a new issue