1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00

Reorder upgrade steps

This commit is contained in:
Yalh 2019-01-25 13:33:47 +01:00 committed by yalh76
parent a27ffca499
commit a4f6a8021e

View file

@ -160,18 +160,6 @@ CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS citext;"
# Open this port
yunohost firewall allow Both "$port" 2>&1
# Give permission to the final_path
chown -R "$app":"$app" "$final_path"
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix local.hex --force )
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix local.rebar --force )
( cd $final_path/$app && sudo -u "$app" mix deps.get )
ynh_psql_execute_as_root \
"ALTER USER $app WITH SUPERUSER;"
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix ecto.migrate --force )
ynh_psql_execute_as_root \
"ALTER USER $app WITH NOSUPERUSER;"
#=================================================
# MODIFY A CONFIG FILE
#=================================================
@ -211,6 +199,21 @@ ynh_backup_if_checksum_is_different "$final_path/$app/config/prod.secret.exs"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum "$final_path/$app/config/prod.secret.exs"
#=================================================
# MAKE UPGRADE
#=================================================
# Give permission to the final_path
chown -R "$app":"$app" "$final_path"
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix local.hex --force )
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix local.rebar --force )
( cd $final_path/$app && sudo -u "$app" mix deps.get )
ynh_psql_execute_as_root \
"ALTER USER $app WITH SUPERUSER;"
( cd $final_path/$app && sudo -u "$app" MIX_ENV=prod mix ecto.migrate --force )
ynh_psql_execute_as_root \
"ALTER USER $app WITH NOSUPERUSER;"
#=================================================
# SETUP LOGROTATE
#=================================================