aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2021-11-18 09:11:19 +0100
committerdispatch <dispatch@listserv.local>2021-11-18 08:16:35 +0000
commitb2c96fe95f4fc59edd5a162d69298fcda0b531ec (patch)
tree4e7e88e2d8698f7177da8e6e82bac6c223801ffa
parent22c3d44a3f5bd4beeb446a31fc3c5e9776eae6ee (diff)
downloadaports-patches/3764.tar.gz
aports-patches/3764.tar.bz2
aports-patches/3764.tar.xz
community/pushgateway: import from sr.ht-apkbuildspatches/3764
-rw-r--r--community/pushgateway/APKBUILD44
-rw-r--r--community/pushgateway/pushgateway.confd4
-rw-r--r--community/pushgateway/pushgateway.initd14
-rw-r--r--community/pushgateway/pushgateway.pre-install4
4 files changed, 66 insertions, 0 deletions
diff --git a/community/pushgateway/APKBUILD b/community/pushgateway/APKBUILD
new file mode 100644
index 0000000000..ebb92eac57
--- /dev/null
+++ b/community/pushgateway/APKBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Drew DeVault <sir@cmpwn.com>
+pkgname=pushgateway
+pkgver=1.4.2
+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 mod vendor
+ 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="
+7b1da7eecf03c4f7b493d025920e93c52333becf7da6a2d7bdd0eb6f9a2a4a5d08b00786d0796682a465d84750e2c8092cdb1c4ca59a08f15b8b586d6eaa5f1a pushgateway-1.4.2.tar.gz
+39b797f6a38b02f84f94cfdbc5c860af060b044eaf98d7ec99909c4abcb9bf6112755bbd21460bfda9825b31715e403fedb6c88158072cd79d985429bcb5cf01 pushgateway.confd
+8dec09ad9b420da54f6f9434307c07d905c4bb17c2bc68fc4863e2bc2288ae1c8faf5757485ad4b0ebb89a78e907f6ccaf11f8379e8ab71e5e88f7c741657f6f pushgateway.initd
+"
diff --git a/community/pushgateway/pushgateway.confd b/community/pushgateway/pushgateway.confd
new file mode 100644
index 0000000000..ef34175c7d
--- /dev/null
+++ b/community/pushgateway/pushgateway.confd
@@ -0,0 +1,4 @@
+pushgateway_bind_address=':9091'
+
+output_log=/var/log/pushgateway.log
+error_log=/var/log/pushgateway.log
diff --git a/community/pushgateway/pushgateway.initd b/community/pushgateway/pushgateway.initd
new file mode 100644
index 0000000000..2975f0cc07
--- /dev/null
+++ b/community/pushgateway/pushgateway.initd
@@ -0,0 +1,14 @@
+#!/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"
+
+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
+}
diff --git a/community/pushgateway/pushgateway.pre-install b/community/pushgateway/pushgateway.pre-install
new file mode 100644
index 0000000000..004fd0bcb9
--- /dev/null
+++ b/community/pushgateway/pushgateway.pre-install
@@ -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