mirror of
https://git.cloudron.io/cloudron/prometheus-server-app.git
synced 2024-12-28 18:10:31 +00:00
059fc273f1
this brings it in line with other packages
23 lines
837 B
Bash
Executable file
23 lines
837 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
mkdir -p /app/data/runtime /app/data/config
|
|
|
|
if [[ ! -f /app/data/config/prometheus.yml ]]; then
|
|
echo "=> Creating config file on first run"
|
|
cp /app/code/prometheus.yml /app/data/config/prometheus.yml
|
|
fi
|
|
|
|
chown -R cloudron:cloudron /app/data
|
|
|
|
if [[ ! -f /app/data/prometheus_variables.sh ]]; then
|
|
echo "=> Copy default prometheus variable file since it does not exist"
|
|
cp /app/pkg/default_prometheus_variables.sh /app/data/prometheus_variables.sh
|
|
fi
|
|
|
|
echo "=> Source custom variables"
|
|
source /app/data/prometheus_variables.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}"
|