View | Details | Raw Unified | Return to bug 233660
Collapse All | Expand All

(-)net-mgmt/pushgateway/Makefile (-4 / +10 lines)
Lines 1-33 Link Here
1
# Created by: Athanasios Douitsis <aduitsis@cpan.org>
1
# Created by: Athanasios Douitsis <aduitsis@cpan.org>
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	pushgateway
4
PORTNAME=	pushgateway
5
PORTVERSION=	0.3.1
5
DISTVERSIONPREFIX=	v
6
PORTREVISION=	1
6
DISTVERSION=	0.6.0
7
DISTVERSIONPREFIX=v
8
CATEGORIES=	net-mgmt
7
CATEGORIES=	net-mgmt
9
8
10
MAINTAINER=	aduitsis@cpan.org
9
MAINTAINER=	aduitsis@cpan.org
11
COMMENT=	Prometheus push acceptor for ephemeral and batch jobs
10
COMMENT=	Prometheus push acceptor for ephemeral and batch jobs
12
11
13
LICENSE=	APACHE20
12
LICENSE=	APACHE20
13
LICENSE_FILE=	${WRKSRC}/LICENSE
14
14
15
USES=		go gmake
15
USES=		go gmake
16
GH_ACCOUNT=	prometheus
16
GH_ACCOUNT=	prometheus
17
USE_GITHUB=	yes
17
USE_GITHUB=	yes
18
18
19
GO_PKGNAME=	github.com/${GH_ACCOUNT}/${PORTNAME}
19
GO_PKGNAME=	github.com/${GH_ACCOUNT}/${PORTNAME}
20
20
21
USE_RC_SUBR=	pushgateway
21
USE_RC_SUBR=	pushgateway
22
22
23
USERS=		prometheus
23
USERS=		prometheus
24
GROUPS=		prometheus
24
GROUPS=		prometheus
25
25
26
do-build:
26
do-build:
27
	@(cd ${GO_WRKSRC} ; ${SETENV} ${MAKE_ENV} ${GO_ENV} go install)
27
	cd ${GO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install
28
28
29
do-install:
29
do-install:
30
	${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/pushgateway ${STAGEDIR}${PREFIX}/bin
30
	${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/pushgateway ${STAGEDIR}${PREFIX}/bin
31
	${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/${PORTNAME}
31
	${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/${PORTNAME}
32
32
33
pre-test:
34
	${LN} -sf ${WRKSRC}/vendor ${WRKSRC}/src
35
36
do-test:
37
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO_ENV} GOPATH="${WRKDIR}:${WRKSRC}:${LOCAL_GOPATH}" ${GMAKE} test
38
33
.include <bsd.port.mk>
39
.include <bsd.port.mk>
(-)net-mgmt/pushgateway/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1486461319
1
TIMESTAMP = 1543574321
2
SHA256 (prometheus-pushgateway-v0.3.1_GH0.tar.gz) = 6b0fffd0ffd05babbcfd8838027e4bad8ee4d91aeaca705aa83d7ddf1f8bb6c6
2
SHA256 (prometheus-pushgateway-v0.6.0_GH0.tar.gz) = 4a905e54ee8f180e3150a0d12757b933e63a63e1e09251348a2094c70dd20da7
3
SIZE (prometheus-pushgateway-v0.3.1_GH0.tar.gz) = 1140371
3
SIZE (prometheus-pushgateway-v0.6.0_GH0.tar.gz) = 1768979
(-)net-mgmt/pushgateway/files/pushgateway.in (-2 / +2 lines)
Lines 1-66 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
# 
2
#
3
# $FreeBSD$
3
# $FreeBSD$
4
4
5
# PROVIDE: pushgateway
5
# PROVIDE: pushgateway
6
# REQUIRE: LOGIN
6
# REQUIRE: LOGIN
7
# KEYWORD: shutdown
7
# KEYWORD: shutdown
8
#
8
#
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
10
# to enable this service:
10
# to enable this service:
11
#
11
#
12
# pushgateway_enable (bool):	 Set to NO by default
12
# pushgateway_enable (bool):	 Set to NO by default
13
#							   Set it to YES to enable pushgateway
13
#							   Set it to YES to enable pushgateway
14
# pushgateway_user (string):	 Set user to run pushgateway
14
# pushgateway_user (string):	 Set user to run pushgateway
15
#							   Default is "prometheus"
15
#							   Default is "prometheus"
16
# pushgateway_group (string):	Set group to run pushgateway
16
# pushgateway_group (string):	Set group to run pushgateway
17
#							   Default is "prometheus"
17
#							   Default is "prometheus"
18
# pushgateway_data_dir (string): Set dir to run pushgateway in
18
# pushgateway_data_dir (string): Set dir to run pushgateway in
19
#							   Default is "/var/db/pushgateway"
19
#							   Default is "/var/db/pushgateway"
20
# pushgateway_persistence_file (string): Set file in which the pushed
20
# pushgateway_persistence_file (string): Set file in which the pushed
21
#				metrics will be persisted
21
#				metrics will be persisted
22
#							   Default is "${pushgateway_data_dir}/persistent.data"
22
#							   Default is "${pushgateway_data_dir}/persistent.data"
23
# pushgateway_log_file (string): Set file that pushgateway will log to
23
# pushgateway_log_file (string): Set file that pushgateway will log to
24
#							   Default is "/var/log/pushgateway.log"
24
#							   Default is "/var/log/pushgateway.log"
25
# pushgateway_args (string):	 Set additional command line arguments
25
# pushgateway_args (string):	 Set additional command line arguments
26
#							   Default is ""
26
#							   Default is ""
27
27
28
. /etc/rc.subr
28
. /etc/rc.subr
29
29
30
name=pushgateway
30
name=pushgateway
31
rcvar=pushgateway_enable
31
rcvar=pushgateway_enable
32
32
33
load_rc_config $name
33
load_rc_config $name
34
34
35
: ${pushgateway_enable:=NO}
35
: ${pushgateway_enable:=NO}
36
: ${pushgateway_user:=prometheus}
36
: ${pushgateway_user:=prometheus}
37
: ${pushgateway_group:=prometheus}
37
: ${pushgateway_group:=prometheus}
38
: ${pushgateway_data_dir=/var/db/pushgateway}
38
: ${pushgateway_data_dir=/var/db/pushgateway}
39
: ${pushgateway_persistence_file=${pushgateway_data_dir}/persistent.data}
39
: ${pushgateway_persistence_file=${pushgateway_data_dir}/persistent.data}
40
: ${pushgateway_log_file=/var/log/pushgateway.log}
40
: ${pushgateway_log_file=/var/log/pushgateway.log}
41
41
42
pidfile=/var/run/pushgateway.pid
42
pidfile=/var/run/pushgateway.pid
43
command=/usr/sbin/daemon
43
command=/usr/sbin/daemon
44
procname="%%PREFIX%%/bin/pushgateway"
44
procname="%%PREFIX%%/bin/pushgateway"
45
sig_reload=HUP
45
sig_reload=HUP
46
extra_commands=reload
46
extra_commands=reload
47
command_args="-p ${pidfile} /usr/bin/env ${procname} \
47
command_args="-p ${pidfile} /usr/bin/env ${procname} \
48
				-persistence.file=${pushgateway_persistence_file} \
48
				--persistence.file=${pushgateway_persistence_file} \
49
				${pushgateway_args} > ${pushgateway_log_file} 2>&1"
49
				${pushgateway_args} > ${pushgateway_log_file} 2>&1"
50
50
51
start_precmd=pushgateway_startprecmd
51
start_precmd=pushgateway_startprecmd
52
52
53
pushgateway_startprecmd()
53
pushgateway_startprecmd()
54
{
54
{
55
	if [ ! -e ${pidfile} ]; then
55
	if [ ! -e ${pidfile} ]; then
56
		install -o ${pushgateway_user} -g ${pushgateway_group} /dev/null ${pidfile};
56
		install -o ${pushgateway_user} -g ${pushgateway_group} /dev/null ${pidfile};
57
	fi
57
	fi
58
	if [ ! -f "${pushgateway_log_file}" ]; then
58
	if [ ! -f "${pushgateway_log_file}" ]; then
59
		install -o ${pushgateway_user} -g ${pushgateway_group} -m 640 /dev/null ${pushgateway_log_file};
59
		install -o ${pushgateway_user} -g ${pushgateway_group} -m 640 /dev/null ${pushgateway_log_file};
60
	fi
60
	fi
61
	if [ ! -d ${pushgateway_data_dir} ]; then
61
	if [ ! -d ${pushgateway_data_dir} ]; then
62
		install -d -o ${pushgateway_user} -g ${pushgateway_group} -m 750 ${pushgateway_data_dir}
62
		install -d -o ${pushgateway_user} -g ${pushgateway_group} -m 750 ${pushgateway_data_dir}
63
	fi
63
	fi
64
}
64
}
65
65
66
run_rc_command "$1"
66
run_rc_command "$1"

Return to bug 233660