diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2018-03-27 15:38:22 +0200 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2018-03-27 15:38:22 +0200 |
commit | 61aa656e8ac748cbaca5fc92cdfd871af998a292 (patch) | |
tree | 7f03a729f0adbb6c91f567f86e845990432a5287 /app-metrics/alertmanager | |
parent | app-metrics/prometheus: Remove old (diff) | |
download | gentoo-61aa656e8ac748cbaca5fc92cdfd871af998a292.tar.gz gentoo-61aa656e8ac748cbaca5fc92cdfd871af998a292.tar.bz2 gentoo-61aa656e8ac748cbaca5fc92cdfd871af998a292.zip |
app-metrics/alertmanager: Move package from net-analyzer/prometheus-alertmanager
Diffstat (limited to 'app-metrics/alertmanager')
-rw-r--r-- | app-metrics/alertmanager/Manifest | 1 | ||||
-rw-r--r-- | app-metrics/alertmanager/alertmanager-0.14.0-r1.ebuild | 52 | ||||
-rw-r--r-- | app-metrics/alertmanager/files/alertmanager.confd | 2 | ||||
-rw-r--r-- | app-metrics/alertmanager/files/alertmanager.initd | 28 | ||||
-rw-r--r-- | app-metrics/alertmanager/metadata.xml | 11 |
5 files changed, 94 insertions, 0 deletions
diff --git a/app-metrics/alertmanager/Manifest b/app-metrics/alertmanager/Manifest new file mode 100644 index 000000000000..837df56dd514 --- /dev/null +++ b/app-metrics/alertmanager/Manifest @@ -0,0 +1 @@ +DIST alertmanager-0.14.0.tar.gz 2786623 BLAKE2B e9c773af81153b3062d27464c6b8d1edcafe66575b8d5a6309b162c6546d3dedf7ae5b1afcf4dafb3dfdb6bcf826aeb9119b27cfe596da365a6272ee71b30441 SHA512 e352d51d86b853ff679892df3c494da2c7b4afb918d807e6d63b76e959b586f43a4c773de18bdd9e6a5067d4034748bb304ebdee2f08983b00890c1ae393d0b8 diff --git a/app-metrics/alertmanager/alertmanager-0.14.0-r1.ebuild b/app-metrics/alertmanager/alertmanager-0.14.0-r1.ebuild new file mode 100644 index 000000000000..43de943ea4fb --- /dev/null +++ b/app-metrics/alertmanager/alertmanager-0.14.0-r1.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit user golang-build golang-vcs-snapshot + +EGO_PN="github.com/prometheus/alertmanager" +EGIT_COMMIT="v${PV/_rc/-rc.}" +ALERTMANAGER_COMMIT="fb713f6" +ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +KEYWORDS="~amd64" + +DESCRIPTION="Alertmanager for alerts sent by client applications such as Prometheus" +HOMEPAGE="https://github.com/prometheus/alertmanager" +SRC_URI="${ARCHIVE_URI}" +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +DEPEND="dev-util/promu" + +RESTRICT="test" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +src_prepare() { + default + sed -i -e "s/{{.Revision}}/${ALERTMANAGER_COMMIT}/" src/${EGO_PN}/.promu.yml || die +} + +src_compile() { + pushd src/${EGO_PN} || die + mkdir -p bin || die + GOPATH="${S}" promu build -v --prefix bin || die + popd || die +} + +src_install() { + pushd src/${EGO_PN} || die + dobin bin/* + dodoc {README,CHANGELOG,CONTRIBUTING}.md + insinto /etc/alertmanager/ + newins doc/examples/simple.yml config.yml.example + popd || die + keepdir /var/lib/alertmanager /var/log/alertmanager + fowners ${PN}:${PN} /var/lib/alertmanager /var/log/alertmanager + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} diff --git a/app-metrics/alertmanager/files/alertmanager.confd b/app-metrics/alertmanager/files/alertmanager.confd new file mode 100644 index 000000000000..57c769e41a76 --- /dev/null +++ b/app-metrics/alertmanager/files/alertmanager.confd @@ -0,0 +1,2 @@ +# arguments for prometheus alertmanager +command_args="--config.file=/etc/alertmanager/config.yml --storage.path=/var/lib/alertmanager" diff --git a/app-metrics/alertmanager/files/alertmanager.initd b/app-metrics/alertmanager/files/alertmanager.initd new file mode 100644 index 000000000000..5d625ac57bb8 --- /dev/null +++ b/app-metrics/alertmanager/files/alertmanager.initd @@ -0,0 +1,28 @@ +#!/sbin/openrc-run +# Copyright 2016-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Prometheus alertmanager" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/bin/alertmanager" +command_args="${command_args:---config.file=/etc/alertmanager/config.yml --storage.path=/var/lib/alertmanager}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/alertmanager/${RC_SVCNAME}.log \ + --stderr /var/log/alertmanager/${RC_SVCNAME}.log" + +extra_started_commands="reload" + +depend() { + after net +} + +reload() { + ebegin "Reloading ${SVCNAME}" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? "Failed to stop ${SVCNAME}" +} + diff --git a/app-metrics/alertmanager/metadata.xml b/app-metrics/alertmanager/metadata.xml new file mode 100644 index 000000000000..714320b4f365 --- /dev/null +++ b/app-metrics/alertmanager/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>mrueg@gentoo.org</email> + <name>Manuel Rüger</name> + </maintainer> + <upstream> + <remote-id type="github">prometheus/alertmanager</remote-id> + </upstream> +</pkgmetadata> |