mirror of
https://github.com/YunoHost-Apps/fab-manager_ynh.git
synced 2024-09-03 18:36:16 +02:00
Fix restore, upgrade
This commit is contained in:
parent
7b98618b0f
commit
977291313b
3 changed files with 12 additions and 9 deletions
|
@ -76,6 +76,7 @@ ynh_add_nginx_config
|
|||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config --service="$app-app" --template="fab-manager-app.service"
|
||||
yunohost service add "$app-app" --description="$app app service"
|
||||
|
||||
ynh_add_systemd_config --service="$app-worker" --template="fab-manager-worker.service"
|
||||
yunohost service add "$app-worker" --description="$app worker service"
|
||||
|
||||
|
|
|
@ -46,9 +46,8 @@ ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH S
|
|||
ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS unaccent;"
|
||||
ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
||||
ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;"
|
||||
ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH NOSUPERUSER;"
|
||||
|
||||
ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
|
||||
ynh_psql_execute_as_root --database="$db_name" --sql="ALTER USER $db_user WITH NOSUPERUSER;"
|
||||
|
||||
#=================================================
|
||||
# BUILD APP
|
||||
|
@ -66,9 +65,11 @@ ynh_script_progression --message="Restoring system configurations related to $ap
|
|||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app-app.service"
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app-worker.service"
|
||||
systemctl enable "$app-app" "$app-worker" --quiet
|
||||
systemctl enable "$app-app" --quiet
|
||||
yunohost service add "$app-app" --description="$app app service"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app-worker.service"
|
||||
systemctl enable "$app-worker" --quiet
|
||||
yunohost service add "$app-worker" --description="$app worker service"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -54,7 +54,7 @@ ynh_exec_warn_less ynh_install_ruby --ruby_version="$ruby_version"
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config/secrets.yml config/database.yml"
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env config/database.yml"
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R "$app:www-data" "$install_dir"
|
||||
|
@ -64,9 +64,9 @@ chown -R "$app:www-data" "$install_dir"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template="secrets.yml" --destination="$install_dir/config/secrets.yml"
|
||||
chmod 400 "$install_dir/config/secrets.yml"
|
||||
chown "$app:$app" "$install_dir/config/secrets.yml"
|
||||
ynh_add_config --template="dot_env" --destination="$install_dir/.env"
|
||||
chmod 400 "$install_dir/.env"
|
||||
chown "$app:$app" "$install_dir/.env"
|
||||
|
||||
ynh_add_config --template="database.yml" --destination="$install_dir/config/database.yml"
|
||||
chmod 400 "$install_dir/config/database.yml"
|
||||
|
@ -96,8 +96,9 @@ ynh_add_nginx_config
|
|||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config --service="$app-app" --template="fab-manager-app.service"
|
||||
ynh_add_systemd_config --service="$app-worker" --template="fab-manager-worker.service"
|
||||
yunohost service add "$app-app" --description="$app app service"
|
||||
|
||||
ynh_add_systemd_config --service="$app-worker" --template="fab-manager-worker.service"
|
||||
yunohost service add "$app-worker" --description="$app worker service"
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue