A prometheus/alertmanager/APKBUILD => prometheus/alertmanager/APKBUILD +43 -0
@@ 0,0 1,43 @@
+# Maintainer: Drew DeVault <sir@cmpwn.com>
+pkgname=alertmanager
+pkgver=0.16.2
+pkgrel=0
+pkgdesc="Prometheus Alertmanager"
+url="https://github.com/prometheus/alertmanager"
+arch="all"
+license="Apache-2.0"
+makedepends="go bzr"
+source="
+ $pkgname-$pkgver.tar.gz::https://github.com/prometheus/alertmanager/archive/v$pkgver.tar.gz
+ alertmanager.initd
+"
+subpackages="$pkgname-openrc"
+builddir="$srcdir/$pkgname-$pkgver"
+options="!check" # broken time tests upstream
+
+build() {
+ cd "$builddir"
+ go build -o alertmanager cmd/alertmanager/main.go
+ go build -o amtool cmd/amtool/main.go
+}
+
+check() {
+ cd "$builddir"
+ go test ./...
+}
+
+package() {
+ cd "$builddir"
+ install -Dm755 alertmanager "$pkgdir"/usr/bin/alertmanager
+ install -Dm755 amtool "$pkgdir"/usr/bin/amtool
+
+ install -Dm755 examples/ha/alertmanager.yml \
+ "$pkgdir"/etc/alertmanager/alertmanager.yml
+ install -d -m755 -o 211 -g 211 "$pkgdir"/var/lib/alertmanager
+
+ install -Dm755 "$srcdir"/alertmanager.initd \
+ "$pkgdir"/etc/init.d/alertmanager
+}
+
+sha512sums="94012739c5c9691ff34bb521e220e00de13ef866451ffaaa8d45f85c228c6b515a84550a819b351db36e3da7c17a0fa397b5b1c6a4cbc3451442f5064a0184a3 alertmanager-0.16.2.tar.gz
+40c5fd04ce4d501bbd33b16abab77d47fee98cb035f9786ae231f052edbc8c6e2a3c09505269ab2c7ff6c44f3a3c129f54df7c8abe92033750666097b77668fe alertmanager.initd"
A prometheus/alertmanager/alertmanager.initd => prometheus/alertmanager/alertmanager.initd +21 -0
@@ 0,0 1,21 @@
+#!/sbin/openrc-run
+name="alertmanager"
+description="prometheus alertmanager"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting $name"
+ start-stop-daemon -C --background --make-pidfile --pidfile /run/$name.pid \
+ --exec /usr/bin/alertmanager -- \
+ --config.file=/etc/alertmanager/alertmanager.yml
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping $name"
+ start-stop-daemon --stop --exec /usr/bin/alertmanager --pidfile /run/$name.pid
+ eend $?
+}