Browse Source

chg: [mattermost] upd img to 5.30.1 and add DATASOURCE to connect db

bgallet/mattermost
Boris Gallet 2 weeks ago
parent
commit
ad17e36ba3
  1. 7
      mattermost/hooks/postgres_database-relation-joined
  2. 3
      mattermost/metadata.yml

7
mattermost/hooks/postgres_database-relation-joined

@ -20,12 +20,15 @@ services:
MM_PASSWORD: $PASSWORD
MM_USERNAME: $USER
"
DATASOURCE="postgres://${USER}:${PASSWORD}@${HOST}:${PORT}/${DBNAME}?sslmode=disable\&connect_timeout=10"
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
sed -ri 's|("DataSource": ")[^"]*(")|\1'"$DATASOURCE"'\2|' \
"$SERVICE_CONFIGSTORE/mattermost/config/config.json" || exit 1
fi
[ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0

3
mattermost/metadata.yml

@ -1,11 +1,12 @@
description: "Mattermost"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
## We fix image here to be sure of what we install
docker-image: docker.0k.io/mattermost-team:5.15.0
docker-image: docker.0k.io/mattermost-team:5.30.1
# docker-image: docker.0k.io/mattermost-enterprise
config-resources:
- /mattermost/config
- /mattermost/plugins
- /mattermost/client-plugins
data-resources:
- /mattermost/data
- /mattermost/logs

Loading…
Cancel
Save