summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Thode <prometheanfire@gentoo.org>2020-03-15 14:43:19 -0500
committerMatthew Thode <prometheanfire@gentoo.org>2020-03-15 14:57:28 -0500
commit3d4fcf4411a9e35f8bb2a9e6072c58ff1452eb0b (patch)
tree22b5dedaad31428d4841fa7e2801dceba148299e /app-metrics
parentacct-user/node_exporter: add node_exporter user (diff)
downloadgentoo-3d4fcf4411a9e35f8bb2a9e6072c58ff1452eb0b.tar.gz
gentoo-3d4fcf4411a9e35f8bb2a9e6072c58ff1452eb0b.tar.bz2
gentoo-3d4fcf4411a9e35f8bb2a9e6072c58ff1452eb0b.zip
app-metrics/node_exporter: update to 1.0.0-rc0
also migrate to acct packages Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/node_exporter/Manifest1
-rw-r--r--app-metrics/node_exporter/files/node_exporter.service10
-rw-r--r--app-metrics/node_exporter/node_exporter-1.0.0_rc0.ebuild53
3 files changed, 64 insertions, 0 deletions
diff --git a/app-metrics/node_exporter/Manifest b/app-metrics/node_exporter/Manifest
index be1e49b6836e..f0bd23b02a77 100644
--- a/app-metrics/node_exporter/Manifest
+++ b/app-metrics/node_exporter/Manifest
@@ -1 +1,2 @@
DIST node_exporter-0.18.1.tar.gz 2110072 BLAKE2B 48c73d00cba892e34e95d40bd29c9ca70bc5748590f00cb7f8adcd25d8a9504f669d887b1273cc65316ca55b06c36d97a3e19a66382f35d5768db7c315981a13 SHA512 cf2b854fbec1ba39b18432cdc11ab507ebc5b2828e6b34b4f49af9b949fcd365cb3e5eb1e265d0825783810c6b1572a8b3512ec27a46e5c83f89a505590159c0
+DIST node_exporter-1.0.0_rc0.tar.gz 2753717 BLAKE2B 2e1984d080ce2a16ca710a3da882b311510b2741836d615075281f5fce2641be35084090d9bcedcb8bf4f6a18333c5fcd53eb98817d1efed4c1a26261a02bffd SHA512 ec1d79367c69a7ccdacc9482a38625ffc9adab6d781b789cc226eed0bd893deca5cfc420a096f790ccd57834492551d36e2f307ad27a6c67585c8ef31887b50f
diff --git a/app-metrics/node_exporter/files/node_exporter.service b/app-metrics/node_exporter/files/node_exporter.service
new file mode 100644
index 000000000000..3235924f7850
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Node Exporter
+
+[Service]
+User=node_exporter
+EnvironmentFile=/etc/sysconfig/node_exporter
+ExecStart=/usr/bin/node_exporter $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-metrics/node_exporter/node_exporter-1.0.0_rc0.ebuild b/app-metrics/node_exporter/node_exporter-1.0.0_rc0.ebuild
new file mode 100644
index 000000000000..9eae734e4acd
--- /dev/null
+++ b/app-metrics/node_exporter/node_exporter-1.0.0_rc0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit golang-build golang-vcs-snapshot systemd
+
+EGO_PN="github.com/prometheus/node_exporter"
+EGIT_COMMIT="v${PV/_rc/-rc.}"
+NODE_EXPORTER_COMMIT="ef7c058"
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Prometheus exporter for machine metrics"
+HOMEPAGE="https://github.com/prometheus/node_exporter"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0 BSD BSD-2 MIT"
+SLOT="0"
+IUSE=""
+
+CDEPEND="acct-group/node_exporter
+ acct-user/node_exporter"
+DEPEND=">=dev-lang/go-1.12
+ >=dev-util/promu-0.3.0
+ ${CDEPEND}"
+RDEPEND="${CDEPEND}"
+
+src_prepare() {
+ default
+ sed -i -e "s/{{.Revision}}/${NODE_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
+}
+
+src_compile() {
+ pushd src/${EGO_PN} || die
+ mkdir -p bin || die
+ GO111MODULE=on GOPATH="${S}" GOCACHE="${T}"/go-cache promu build -v --prefix node_exporter || die
+ popd || die
+}
+
+src_install() {
+ # binary and docs
+ dobin src/"${EGO_PN}"/node_exporter/node_exporter
+ dodoc src/"${EGO_PN}"/{README,CHANGELOG,CONTRIBUTING}.md
+ # systemd
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ insinto /etc/sysconfig
+ newins src/"${EGO_PN}"/examples/systemd/sysconfig.node_exporter node_exporter
+ # openrc
+ newinitd "${FILESDIR}"/${PN}-1.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ # maintence
+ keepdir /var/lib/node_exporter /var/log/node_exporter
+ fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter
+}