app-metrics/pushgateway: Version bump to 0.5.0

Package-Manager: Portage-2.3.38, Repoman-2.3.9
This commit is contained in:
Manuel Rüger
2018-05-25 02:49:19 +02:00
parent 44bbe2e60f
commit 5ff6e1a344
5 changed files with 101 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST pushgateway-0.4.0.tar.gz 1140644 BLAKE2B ea82e2e7f6fd817de02044e5aafde724a4089e4f2961f0b581f90df7e04e65af5a3c3e044ef94bd600a92468a8aed791c838a8fdc64b05b7a91d6288e7e96fb3 SHA512 67f25e5f7fdc54143c5d10720f27bd256f22695ced93088cf2b72fe3197e45324d4353357ae40d7d3e92019480c0bec009e38ed3f583724d46411d76adbdc927
DIST pushgateway-0.5.0.tar.gz 1566969 BLAKE2B 255592d172ba910cd4c031f33045ee92fa02b8ba04c69a844e1a81d0fb4c0425f4a71931c917cb70f90422e25ad8761892cde344acb3fa7465e682ff8671f31b SHA512 d0a96aa8b1a59266a8864ab760ad6fdbdc131c49b08aa3bf89f54ed9c6ced6a4b7ab2f8c70d15dad1605ec7b46c5e784dc77be10f26ebd56a3a0f16f7285d607

View File

@@ -0,0 +1,14 @@
# --log.format value
# If set use a syslog logger or JSON logging. Example: logger:syslog?appname=bob&local=7 or logger:stdout?json=true. Defaults to stderr.
# --log.level value
# Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal].
# --persistence.file string
# File to persist metrics. If empty, metrics are only kept in memory.
# --persistence.interval duration
# The minimum interval at which to write out the persistence file. (default 5m0s)
# --web.listen-address string
# Address to listen on for the web interface, API, and telemetry. (default ":9091")
# --web.telemetry-path string
# Path under which to expose metrics. (default "/metrics")
#command_args="--web.listen-address localhost:9091 --persistence.file=/var/lib/${RC_SVCNAME}/persistence.gob"

View File

@@ -0,0 +1,19 @@
#!/sbin/openrc-run
# Copyright 2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
description="Prometheus push acceptor for ephemeral and batch jobs"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
user=${user:-${RC_SVCNAME}}
group=${group:-${RC_SVCNAME}}
command="/usr/bin/pushgateway"
command_args="${command_args:---web.listen-address localhost:9091 --persistence.file=/var/lib/${RC_SVCNAME}/persistence.gob}"
command_background="true"
start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
--stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
depend() {
need net
}

View File

@@ -0,0 +1,16 @@
[Unit]
Description=Prometheus exporter for ephemereal jobs
Documentation=https://prometheus.io/docs/instrumenting/pushing/
After=network-online.target
[Service]
User=pushgateway
Restart=on-failure
Environment=PUSHGATEWAY_ARGS="--web.listen-address localhost:9091 --persistence.file=/var/lib/pushgateway/persistence.gob"
ExecStart=/usr/bin/pushgateway $PUSHGATEWAY_ARGS
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStopSec=20s
SendSIGKILL=no
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,51 @@
# 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 systemd
EGO_PN="github.com/prometheus/pushgateway"
EGIT_COMMIT="v${PV/_rc/-rc.}"
GIT_COMMIT="3965d2a"
ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
DESCRIPTION="Prometheus push acceptor for ephemeral and batch jobs"
HOMEPAGE="https://github.com/prometheus/pushgateway"
SRC_URI="${ARCHIVE_URI}"
LICENSE="Apache-2.0"
SLOT="0"
IUSE=""
DEPEND="dev-util/promu"
pkg_setup() {
enewgroup ${PN}
enewuser ${PN} -1 -1 -1 ${PN}
}
src_prepare() {
default
sed -i -e "s/{{.Revision}}/${GIT_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/pushgateway
dodoc {README,CHANGELOG,CONTRIBUTING}.md
popd || die
keepdir /var/lib/${PN} /var/log/${PN}
fowners ${PN}:${PN} /var/lib/${PN} /var/log/${PN}
newinitd "${FILESDIR}"/${PN}-1.initd ${PN}
newconfd "${FILESDIR}"/${PN}-1.confd ${PN}
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotated" "${PN}"
systemd_dounit "${FILESDIR}/${PN}-1.service"
}