aboutsummaryrefslogtreecommitdiffstats
path: root/community/prometheus
diff options
context:
space:
mode:
authornixfloyd <nixfloyd@gmail.com>2020-01-01 01:59:00 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2020-01-01 18:17:19 +0000
commit7c4d5caee472bf0e011b35742ed81d896a7b1d54 (patch)
tree7fb682690020fd1cef3f0cfd85226e16f2cd0e0b /community/prometheus
parent51d496a24ed30cf9693e3a1d5ee1b6902971fa9b (diff)
downloadaports-7c4d5caee472bf0e011b35742ed81d896a7b1d54.tar.bz2
aports-7c4d5caee472bf0e011b35742ed81d896a7b1d54.tar.xz
community/prometheus: fix init scripts and assets
- Fix the init script to reference the correct variables (otherwise prometheus tries to start in /) - Embed static assets so that the built-in web-ui will work, without adding extra files to the package Closes !2652
Diffstat (limited to 'community/prometheus')
-rw-r--r--community/prometheus/APKBUILD15
-rw-r--r--community/prometheus/prometheus.confd1
-rw-r--r--community/prometheus/prometheus.initd5
3 files changed, 16 insertions, 5 deletions
diff --git a/community/prometheus/APKBUILD b/community/prometheus/APKBUILD
index b89bd388f7..4eca63611c 100644
--- a/community/prometheus/APKBUILD
+++ b/community/prometheus/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=prometheus
pkgver=2.15.1
-pkgrel=0
+pkgrel=1
pkgdesc="The Prometheus monitoring system and time series database"
url="https://github.com/prometheus/prometheus"
arch="all"
@@ -16,11 +16,20 @@ source="
subpackages="$pkgname-openrc"
options="!check" # Broken by integrations we don't care about
+prepare() {
+ default_prepare
+ cd web/ui
+ go generate -x -v
+ cd ../../
+ gofmt -w ./web/ui
+}
+
build() {
go build \
-trimpath \
-mod=vendor \
-ldflags "-extldflags $LDFLAGS" \
+ -tags netgo,builtinassets \
./cmd/prometheus
go build \
-trimpath \
@@ -48,5 +57,5 @@ package() {
}
sha512sums="b08dfa48bddb6e007cd0fd4553847e824d6adfc047d97151b8dd12dbd1f67cfb9301824b320f1cabe9644159e6968b3fd2ee8104a5d53822a9965423c4bb47b5 prometheus-2.15.1.tar.gz
-6e0edcae0c64b319926b2cbe92b59be51b00fde15f83098bfe9f622a71d60598aa87d26aaec802716ace17e399900cb05b106087ab28e5dd4eff5106c0f1cbfc prometheus.confd
-e747fa8d806ef9cdf224d63f9802646985b812aaddfd9b6fcc453348f810fec8cce30605f9bbd709809cb66b4638903623a1284efdbdf09725135cc956165475 prometheus.initd"
+24b34e586238d5b331639aa5c43b6a927692f251af2cea2787335eab30d2fc7d46975059595db4697ae0dc1d35b5e23cfc4e4b2e424442c209a05283ca22a239 prometheus.confd
+bdc179cb3b8b5d3416e74a0b31002bd7b456b204404579dd40c38cade43eb26b106d16ea2597755035035eca567d34bfa44913eaa28870c3f22e1105d47908ab prometheus.initd"
diff --git a/community/prometheus/prometheus.confd b/community/prometheus/prometheus.confd
index 75c0b5f3f6..8cf02ffdc1 100644
--- a/community/prometheus/prometheus.confd
+++ b/community/prometheus/prometheus.confd
@@ -1,5 +1,6 @@
prometheus_config_file=/etc/prometheus/prometheus.yml
prometheus_storage_path=/var/lib/prometheus/data
+prometheus_retention_time=15d
output_log=/var/log/prometheus.log
error_log=/var/log/prometheus.log
diff --git a/community/prometheus/prometheus.initd b/community/prometheus/prometheus.initd
index 92b5ba56b7..446466225b 100644
--- a/community/prometheus/prometheus.initd
+++ b/community/prometheus/prometheus.initd
@@ -3,8 +3,9 @@ name="prometheus"
description="prometheus monitoring system & time series database"
supervisor=supervise-daemon
command=/usr/bin/prometheus
-command_args="--config.file=$config_file \
- --storage.tsdb.path=$storage_path"
+command_args="--config.file=$prometheus_config_file \
+ --storage.tsdb.path=$prometheus_storage_path \
+ --storage.tsdb.retention.time=$prometheus_retention_time"
command_user="prometheus:prometheus"
start_pre() {