Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mattermost to v10 and PostgreSQL to v17 #91

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Terminate on error
set -e

MATTERMOST_VERSION=9.11.6
MATTERMOST_VERSION=10.4.1

# Prepare variables for later use
images=()
Expand Down Expand Up @@ -33,7 +33,8 @@ buildah config --entrypoint=/ \
--label="org.nethserver.tcp-ports-demand=2" \
--label="org.nethserver.udp-ports-demand=1" \
--label="org.nethserver.rootfull=0" \
--label="org.nethserver.images=docker.io/postgres:13.13-alpine docker.io/mattermost/mattermost-team-edition:$MATTERMOST_VERSION" \
--label="org.nethserver.min-from=2.1.1" \
--label="org.nethserver.images=docker.io/postgres:17.2-alpine docker.io/mattermost/mattermost-team-edition:$MATTERMOST_VERSION" \
"${container}"
# Commit the image
buildah commit "${container}" "${repobase}/${reponame}"
Expand Down
30 changes: 0 additions & 30 deletions imageroot/update-module.d/10database_upgrade

This file was deleted.

23 changes: 23 additions & 0 deletions imageroot/update-module.d/10migrate_postgres_to_V17
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

#
# Copyright (C) 2025 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# upgrade from postgres 13 to 17
# migration after https://github.com/NethServer/ns8-mattermost/releases/tag/2.1.1

set -e

if podman exec postgres-app psql --version | grep -qE " 13\.[0-9]+"; then
echo "Dumping mattermost postgres database"
podman exec postgres-app pg_dump -U mattuser --format=c mattermost > mattermost.pg_dump
echo "Stopping mattermost"
systemctl stop --user mattermost
echo "Remove the v13 postgres volume"
podman volume rm -f postgres-data
echo "Restoring mattermost postgres database"
../actions/restore-module/40restore-postgres
else
echo "Postgres version is not 13, we do not need to upgrade"
fi
8 changes: 7 additions & 1 deletion imageroot/update-module.d/20restart
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
# along with NethServer. If not, see COPYING.
#

systemctl --user try-restart mattermost.service
# test if the module is upgrading from postgres 13
if [[ "$PREV_POSTGRES_IMAGE" =~ 13\.[0-9]+ ]]; then
systemctl --user restart mattermost.service
else
# the module is not upgrading from postgres 13 and might be not configured
systemctl --user try-restart mattermost.service
fi
Loading