Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 15425780DF9 for <~alpine/aports@lists.alpinelinux.org>; Thu, 18 Nov 2021 10:15:30 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpwn.com; s=key1; t=1637230190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pXYFxf3eihyK2W5tXk8kn8PFcMz3rkTPwXGJDIl2x2o=; b=rFPGSbtu+9aKxNpAGhLOuCqBmKTX9NPi5dg5me08E4ddxn7XQuB9zUYLMyfHX1c4n3gEkH nU+srsppppfkhDt/IyCWc7FeDCxZuknr0A71a9HpkDzLqDIsNjVTh6jkAvERrRBN/brkJO LvV1WXpCPS/STaHrPpOw2Tk9qxzm/upq0nmDyaFD9pMdMFc9BHUr6CWqUNDxJnnAubrgjL 86FCw+SPTm6eaQ16Uy93rwkkOd5gHOTLudO+akH7daCFsxw4Z6ybb6q+hUmZvLYIbn/4zZ vyqdnIDevf36RIzkFV9G9/+Nh7VEtelPqSCkEskZM3ykfAni2ZVFfTAJUpIZKw== From: Drew DeVault To: ~alpine/aports@lists.alpinelinux.org Cc: Drew DeVault Subject: [PATCH v2] community/pushgateway: new aport Date: Thu, 18 Nov 2021 11:09:49 +0100 Message-Id: <20211118100949.24369-1-sir@cmpwn.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: sir@cmpwn.com --- community/pushgateway/APKBUILD | 44 +++++++++++++++++++ community/pushgateway/pushgateway.confd | 4 ++ community/pushgateway/pushgateway.initd | 14 ++++++ community/pushgateway/pushgateway.pre-install | 4 ++ 4 files changed, 66 insertions(+) create mode 100644 community/pushgateway/APKBUILD create mode 100644 community/pushgateway/pushgateway.confd create mode 100644 community/pushgateway/pushgateway.initd create mode 100644 community/pushgateway/pushgateway.pre-install 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 +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 -- 2.34.0