mirror of
https://git.cloudron.io/cloudron/prometheus-server-app.git
synced 2024-11-21 16:01:03 +00:00
read in cli options
This commit is contained in:
parent
ce47fe79fb
commit
c35bfa6977
2 changed files with 10 additions and 3 deletions
|
@ -2,3 +2,5 @@
|
|||
|
||||
# https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
|
||||
export retention_time="15d"
|
||||
|
||||
export cli_options="--storage.tsdb.retention.time=$retention_time --storage.tsdb.path=/app/data/runtime"
|
||||
|
|
11
start.sh
11
start.sh
|
@ -18,8 +18,13 @@ if [[ ! -f /app/data/env.sh ]]; then
|
|||
cp /app/pkg/env.sh.template /app/data/env.sh
|
||||
fi
|
||||
|
||||
echo "=> Source custom variables"
|
||||
# migration remove in next release
|
||||
if ! grep -q cli_option /app/data/env.sh; then
|
||||
echo -e '\nexport cli_options="--storage.tsdb.retention.time=$retention_time --storage.tsdb.path=/app/data/runtime"' >> /app/data/env.sh
|
||||
fi
|
||||
|
||||
echo "=> Source custom variables for cli args"
|
||||
source /app/data/env.sh
|
||||
|
||||
echo "=> Starting Prometheus with retention time of $retention_time"
|
||||
exec /usr/local/bin/gosu cloudron:cloudron /app/code/prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime --storage.tsdb.retention.time="${retention_time:-15d}"
|
||||
echo "=> Starting Prometheus"
|
||||
exec /usr/local/bin/gosu cloudron:cloudron /app/code/prometheus --config.file=/app/data/config/prometheus.yml ${cli_options}
|
||||
|
|
Loading…
Reference in a new issue