Verified Commit d1057aed authored by Quentin Duchemin's avatar Quentin Duchemin
Browse files

Use standard config location for alertmanager to ease amtool usage

parent d713b056
......@@ -8,4 +8,4 @@ USER root
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "/bin/alertmanager", "--config.file=/config/alertmanager-with-secrets.yml", "--storage.path=/alertmanager" ]
CMD [ "/bin/alertmanager", "--config.file=/etc/amtool/config.yml", "--storage.path=/alertmanager" ]
......@@ -12,9 +12,10 @@ fi
# a long debate about whether env variable should be used for configuration,
# and they voted no. See https://github.com/prometheus/prometheus/issues/2357 for exemple.
# We have no other trivial way if we want to commit the configuration file without secrets inside.
cp /config/alertmanager.yml /config/alertmanager-with-secrets.yml
sed -i "s@\$MATTERMOST_WEBHOOK@${MATTERMOST_WEBHOOK}@g" /config/alertmanager-with-secrets.yml
sed -i "s@\$MATTERMOST_CHANNEL@${MATTERMOST_CHANNEL}@g" /config/alertmanager-with-secrets.yml
mkdir -p /etc/amtool
cp /config/alertmanager.yml /etc/amtool/config.yml
sed -i "s@\$MATTERMOST_WEBHOOK@${MATTERMOST_WEBHOOK}@g" /etc/amtool/config.yml
sed -i "s@\$MATTERMOST_CHANNEL@${MATTERMOST_CHANNEL}@g" /etc/amtool/config.yml
# Substitue shell with `command` in Dockerfile
exec $@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment