-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatrixcd.initd
More file actions
executable file
·42 lines (34 loc) · 1.19 KB
/
chatrixcd.initd
File metadata and controls
executable file
·42 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/sbin/openrc-run
# ChatrixCD - Matrix bot for CI/CD automation with Semaphore UI
#
# Note: Alpine Linux with OpenRC is the PRIMARY deployment target for ChatrixCD.
# This init script provides native integration for Alpine Linux systems.
name="ChatrixCD"
description="Matrix bot for CI/CD automation with Semaphore UI"
# Configuration
: ${chatrixcd_user:="chatrixcd"}
: ${chatrixcd_group:="chatrixcd"}
: ${chatrixcd_home:="/opt/chatrixcd"}
: ${chatrixcd_config:="/opt/chatrixcd/config.json"}
: ${chatrixcd_venv:="/opt/chatrixcd/.venv"}
command="${chatrixcd_venv}/bin/chatrixcd"
command_background="yes"
pidfile="/run/${RC_SVCNAME}.pid"
command_user="${chatrixcd_user}:${chatrixcd_group}"
directory="${chatrixcd_home}"
# Output logs
output_log="/var/log/chatrixcd/chatrixcd.log"
error_log="/var/log/chatrixcd/chatrixcd.err"
depend() {
need net
use dns
after firewall
}
start_pre() {
# Create log directory if it doesn't exist
checkpath --directory --owner ${chatrixcd_user}:${chatrixcd_group} --mode 0755 \
/var/log/chatrixcd
# Ensure store directory exists
checkpath --directory --owner ${chatrixcd_user}:${chatrixcd_group} --mode 0755 \
${chatrixcd_home}/store
}