Browse Source

fix: [mattermost] on first launch, there are no ``config.json``.

framadate
Valentin Lab 5 years ago
parent
commit
e0b1b7fb1b
  1. 6
      mattermost/hooks/postgres_database-relation-joined

6
mattermost/hooks/postgres_database-relation-joined

@ -18,8 +18,10 @@ services:
MM_USERNAME: $USER
"
sed -ri 's/(^\s+"DataSource": "postgres:[^:]+:)([^@]+)@/\1'"$PASSWORD"'@/' \
"$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1
if [ -e "$SERVICE_CONFIGSTORE/mattermost/config/config.json" ]; then
sed -ri 's/(^\s+"DataSource": "postgres:[^:]+:)([^@]+)@/\1'"$PASSWORD"'@/' \
"$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1
fi
[ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0

Loading…
Cancel
Save