A sr.ht/pushgateway/APKBUILD => sr.ht/pushgateway/APKBUILD +41 -0
@@ 0,0 1,41 @@
+# Maintainer: Drew DeVault <sir@cmpwn.com>
+pkgname=pushgateway
+pkgver=1.1.0
+pkgrel=0
+pkgdesc="Prometheus push acceptor for ephemeral and batch jobs"
+url="https://github.com/prometheus/pushgateway"
+arch="all"
+license="Apache-2.0"
+install="pushgateway.pre-install"
+makedepends="go yarn bash"
+source="
+ $pkgname-$pkgver.tar.gz::https://github.com/prometheus/pushgateway/archive/v$pkgver.tar.gz
+ pushgateway.confd
+ pushgateway.initd
+"
+subpackages="$pkgname-openrc"
+options="!check" # Broken by integrations we don't care about
+
+build() {
+ go build \
+ -trimpath \
+ -mod=vendor \
+ -ldflags "-extldflags $LDFLAGS"
+}
+
+check() {
+ go test ./...
+}
+
+package() {
+ install -Dm755 pushgateway "$pkgdir"/usr/bin/pushgateway
+
+ install -Dm644 "$srcdir"/pushgateway.confd \
+ "$pkgdir"/etc/conf.d/pushgateway
+ install -Dm755 "$srcdir"/pushgateway.initd \
+ "$pkgdir"/etc/init.d/pushgateway
+}
+
+sha512sums="8c3b37104a36578f7de3ed12bc4632255bce23b022e333eb391e0fd79549d67c987963faa418cea1079bea7cc8e32f4e2503b63c89472c10154448c190f1d5a1 pushgateway-1.1.0.tar.gz
+39b797f6a38b02f84f94cfdbc5c860af060b044eaf98d7ec99909c4abcb9bf6112755bbd21460bfda9825b31715e403fedb6c88158072cd79d985429bcb5cf01 pushgateway.confd
+903fd13fda99fd3095e362efa91deed3c88461384a4ed1d3edfaab8bb7a2f070f5004cefa7a1598ebfa0d20df074d0c70938680b94d672751b9326d35960d6b1 pushgateway.initd"
A sr.ht/pushgateway/pushgateway.confd => sr.ht/pushgateway/pushgateway.confd +4 -0
@@ 0,0 1,4 @@
+pushgateway_bind_address=':9091'
+
+output_log=/var/log/pushgateway.log
+error_log=/var/log/pushgateway.log
A sr.ht/pushgateway/pushgateway.initd => sr.ht/pushgateway/pushgateway.initd +15 -0
@@ 0,0 1,15 @@
+#!/sbin/openrc-run
+name="pushgateway"
+description="Prometheus push acceptor for ephemeral and batch jobs"
+supervisor=supervise-daemon
+command=/usr/bin/pushgateway
+command_args="--web.listen-address=$pushgateway_bind_address"
+command_user="prometheus:prometheus"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+start_pre() {
+ [ -n "$output_log" ] && checkpath -f "$output_log" \
+ -m 644 -o prometheus:prometheus
+ [ -n "$error_log" ] && checkpath -f "$error_log" \
+ -m 644 -o prometheus:prometheus
+}
A sr.ht/pushgateway/pushgateway.pre-install => sr.ht/pushgateway/pushgateway.pre-install +4 -0
@@ 0,0 1,4 @@
+#!/bin/sh
+grep '^prometheus:' /etc/group >/dev/null || addgroup -S prometheus 2>/dev/null
+grep '^prometheus:' /etc/passwd >/dev/null || adduser -SDh/var/lib/prometheus \
+ -s/sbin/nologin -Gprometheus -gprometheus prometheus prometheus 2>/dev/null