Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f9471d71d | ||
|
|
233097e0e6 | ||
|
|
4dcae7074e | ||
|
|
c9d4987e6f |
@@ -22,7 +22,21 @@
|
||||
* Open the configured domain in your browser to create your user account (only works in case mail is configured correctly)
|
||||
* Give yourself admin rights by running `abra app cmd <app-name> app make_last_user_admin`
|
||||
|
||||
## Manuel migration steps when upgrading from 0.6.0+v2.25.2 and earlier to 1.0.0+v2.25.2 and later
|
||||
## Migration guide
|
||||
|
||||
### Upgrading to 4.0.0+v2.25.3 and later
|
||||
|
||||
* Before upgrading to `4.0.0+v2.25.3` and later, one successful deployment of `3.0.0+v2.25.3` shall be performed. Doing both at the same time will lead to complications as 3.0.0 runs rails DB migrations and 4.0.0 upgrades the postgres DB version.
|
||||
|
||||
### Broken releases
|
||||
|
||||
Please do not use these releases, as they are having issues regarding database migrations:
|
||||
|
||||
* 1.0.0+v2.25.2
|
||||
* 2.0.0+v2.25.3
|
||||
* 2.1.0+v2.25.3
|
||||
|
||||
### Manual migration steps when upgrading from 0.6.0+v2.25.2 and earlier to 1.0.0+v2.25.2 and later
|
||||
|
||||
* adapt your env file with the new vars, especially SECRET_DB_PASSWORD_VERSION=v1 and SECRET_SMTP_PASSWORD_VERSION=v1
|
||||
* insert your smtp password with `abra app secret insert <app-name> smtp_password v1 "<your-password>"`
|
||||
|
||||
+3
-2
@@ -71,7 +71,7 @@ services:
|
||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||
- "coop-cloud.${STACK_NAME}.version=2.1.0+v2.25.3"
|
||||
- "coop-cloud.${STACK_NAME}.version=3.0.0+v2.25.3"
|
||||
- "backupbot.backup:=${ENABLE_BACKUPS:-true}"
|
||||
worker:
|
||||
image: loomio/loomio:v2.25.3
|
||||
@@ -97,7 +97,8 @@ services:
|
||||
- loomio_files:/loomio/public/files
|
||||
- loomio_plugins:/loomio/plugins/docker
|
||||
db:
|
||||
image: pgautoupgrade/pgautoupgrade:17-debian
|
||||
# loomio version upgrades and postgres version upgrade should not be performed at the same time.
|
||||
image: postgres:12.17
|
||||
networks:
|
||||
- backend
|
||||
volumes:
|
||||
|
||||
+24
-1
@@ -25,6 +25,7 @@ file_env "DEVISE_SECRET"
|
||||
file_env "SECRET_COOKIE_TOKEN"
|
||||
file_env "POSTGRES_PASSWORD"
|
||||
file_env "SMTP_PASSWORD"
|
||||
export DB_HOST="db"
|
||||
export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}"
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
@@ -36,8 +37,30 @@ else
|
||||
if [ "$TASK" = "worker" ]; then
|
||||
bundle exec sidekiq
|
||||
else
|
||||
sudo apt update -y && sudo apt install -y postgresql-client
|
||||
bundle install
|
||||
bundle exec rake db:prepare
|
||||
|
||||
# running this code instaed of db:prepare in docker_start.sh in loomio container
|
||||
# as postgres container creates empty db, somehow db:prepare cannot cope.
|
||||
# therefore we run db:setup or db:migrate individually
|
||||
if PGPASSWORD=$(cat /run/secrets/db_password) psql -U "$POSTGRES_USER" -h "$DB_HOST" -lqt | cut -d \| -f 1 | grep -wq "$POSTGRES_DB"; then
|
||||
echo "database '$POSTGRES_DB' exists."
|
||||
|
||||
# check if the database contains tables
|
||||
TABLE_COUNT=$(PGPASSWORD=$(cat /run/secrets/db_password) psql -U "$POSTGRES_USER" -h "$DB_HOST" -d "$POSTGRES_DB" -t -c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public';")
|
||||
|
||||
if [ "$TABLE_COUNT" -eq 0 ]; then
|
||||
echo "Database '$POSTGRES_DB' is empty, running db:setup."
|
||||
bundle exec rake db:setup
|
||||
else
|
||||
echo "database '$POSTGRES_DB' not empty, running migrations."
|
||||
bundle exec rake db:migrate
|
||||
fi
|
||||
else
|
||||
echo "database '$POSTGRES_DB' does not exist, running db:setup."
|
||||
bundle exec rake db:setup
|
||||
fi
|
||||
|
||||
bundle exec puma -C config/puma.rb
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ATTENTION: do not skip this relase, otherwise it will lead to database migration complications. This release fixes migration issues of 1.x and 2.x releases.
|
||||
Reference in New Issue
Block a user