build: adds apk, deb, rpm packages with init scripts

This commit is contained in:
Marvin Preuss 2021-10-20 14:33:06 +02:00
parent afa5acff81
commit fede35e870
3 changed files with 57 additions and 0 deletions

View File

@ -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

View 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
}

View 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