build: adds apk, deb, rpm packages with init scripts
This commit is contained in:
parent
afa5acff81
commit
fede35e870
@ -58,3 +58,30 @@ dockers:
|
||||
- ghcr.io/xsteadfastx/iperf3exporter:latest
|
||||
- ghcr.io/xsteadfastx/iperf3exporter:{{ .Tag }}
|
||||
- ghcr.io/xsteadfastx/iperf3exporter:v{{ .Major}}
|
||||
|
||||
nfpms:
|
||||
- formats:
|
||||
- apk
|
||||
- deb
|
||||
- rpm
|
||||
replacements:
|
||||
386: i386
|
||||
homepage: https://go.xsfx.dev/iperf3exporter
|
||||
maintainer: Marvin Preuss <marvin@xsteadfastx.org>
|
||||
dependencies:
|
||||
- iperf3
|
||||
bindir: /usr/local/bin
|
||||
contents:
|
||||
- src: init/openrc/iperf3exporter.init
|
||||
dst: /etc/init.d/iperf3exporter
|
||||
packager: apk
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: init/systemd/iperf3exporter.service
|
||||
dst: /etc/systemd/system/iperf3exporter.service
|
||||
packager: deb
|
||||
- src: init/systemd/iperf3exporter.service
|
||||
dst: /etc/systemd/system/iperf3exporter.service
|
||||
packager: rpm
|
||||
|
16
init/openrc/iperf3exporter.init
Normal file
16
init/openrc/iperf3exporter.init
Normal file
@ -0,0 +1,16 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
supervisor=supervise-daemon
|
||||
|
||||
name="$RC_SVCNAME"
|
||||
description="A iperf3 speedtest exporter for prometheus"
|
||||
command="/usr/local/bin/iperf3exporter"
|
||||
command_args="--listen=0.0.0.0:9119"
|
||||
command_user="nobody"
|
||||
pidfile="/run/$RC_SVCNAME.pid"
|
||||
command_background="yes"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use dns
|
||||
}
|
14
init/systemd/iperf3exporter.service
Normal file
14
init/systemd/iperf3exporter.service
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=A iperf3 speedtest exporter for prometheus
|
||||
After=network-online.target nss-lookup.target
|
||||
Wants=network-online.target nss-lookup.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nobody
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
ExecStart=/usr/local/bin/iperf3exporter
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user