public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-admin/mongodb_exporter/files/, app-admin/mongodb_exporter/
@ 2018-02-27 19:17 Manuel Rüger
  0 siblings, 0 replies; only message in thread
From: Manuel Rüger @ 2018-02-27 19:17 UTC (permalink / raw
  To: gentoo-commits

commit:     7b47a7384b30d6800ffa80426e3d698a289ecd69
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 27 19:17:32 2018 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Tue Feb 27 19:17:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b47a738

app-admin/mongodb_exporter: Initial version

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 app-admin/mongodb_exporter/Manifest                |  1 +
 .../mongodb_exporter/files/mongodb_exporter.confd  |  2 +
 .../mongodb_exporter/files/mongodb_exporter.initd  | 19 +++++++++
 app-admin/mongodb_exporter/metadata.xml            | 11 +++++
 .../mongodb_exporter/mongodb_exporter-0.4.0.ebuild | 47 ++++++++++++++++++++++
 5 files changed, 80 insertions(+)

diff --git a/app-admin/mongodb_exporter/Manifest b/app-admin/mongodb_exporter/Manifest
new file mode 100644
index 00000000000..ef9522c2183
--- /dev/null
+++ b/app-admin/mongodb_exporter/Manifest
@@ -0,0 +1 @@
+DIST mongodb_exporter-0.4.0.tar.gz 3386266 BLAKE2B a6bebada2792e620b2107b72b3ab8b2a4e7a08fc53747f266b30a3cf2fe42ed7e09e3be9aa36332cba2df124947064f545821f355726e09649509c671a56c30b SHA512 0db1abd8c7439239cf59b24968ef33f83c6609a9deaed250315dd7fcb6844ef3d0d0c1f50b979f931beb539038a13eb7b88c03c899333d981112695be2e031b3

diff --git a/app-admin/mongodb_exporter/files/mongodb_exporter.confd b/app-admin/mongodb_exporter/files/mongodb_exporter.confd
new file mode 100644
index 00000000000..bd85fa28830
--- /dev/null
+++ b/app-admin/mongodb_exporter/files/mongodb_exporter.confd
@@ -0,0 +1,2 @@
+# arguments for prometheus mongodb exporter
+command_args="-mongodb.uri=http://localhost:9200"

diff --git a/app-admin/mongodb_exporter/files/mongodb_exporter.initd b/app-admin/mongodb_exporter/files/mongodb_exporter.initd
new file mode 100644
index 00000000000..2a2c985c4f6
--- /dev/null
+++ b/app-admin/mongodb_exporter/files/mongodb_exporter.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 2016-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Prometheus MongoDB exporter"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/mongodb_exporter"
+command_args="${command_args:--mongodb.uri=http://localhost:27017}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+	--stdout /var/log/elasticsearch_exporter/${RC_SVCNAME}.log \
+	--stderr /var/log/elasticsearch_exporter/${RC_SVCNAME}.log"
+
+depend() {
+	after net
+}

diff --git a/app-admin/mongodb_exporter/metadata.xml b/app-admin/mongodb_exporter/metadata.xml
new file mode 100644
index 00000000000..b54031048cb
--- /dev/null
+++ b/app-admin/mongodb_exporter/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">percona/mongodb_exporter</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild b/app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild
new file mode 100644
index 00000000000..5ea07ecd61c
--- /dev/null
+++ b/app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild
@@ -0,0 +1,47 @@
+# 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/percona/mongodb_exporter"
+EXPORTER_COMMIT="01f0ef9"
+ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Prometheus exporter for MongoDB"
+HOMEPAGE="https://github.com/percona/mongodb_exporter"
+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$/d" -e "s/{{.Revision}}/${EXPORTER_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/mongodb_exporter
+	dodoc {README,CHANGELOG}.md
+	popd || die
+	keepdir /var/log/mongodb_exporter
+	fowners ${PN}:${PN} /var/log/mongodb_exporter
+	newinitd "${FILESDIR}"/${PN}.initd ${PN}
+	newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-27 19:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-27 19:17 [gentoo-commits] repo/gentoo:master commit in: app-admin/mongodb_exporter/files/, app-admin/mongodb_exporter/ Manuel Rüger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox