mirror of
https://github.com/YunoHost-Apps/photoview_ynh.git
synced 2024-09-03 20:05:55 +02:00
Reinstall Yarn on upgrade
This commit is contained in:
parent
4dbf117fc6
commit
ea21f66716
8 changed files with 34 additions and 34 deletions
|
@ -6,7 +6,7 @@
|
|||
"en": "Simple and user-friendly photo gallery that's made for photographers ",
|
||||
"fr": "Galerie photos simple et facile à utiliser, faite pour les photographes"
|
||||
},
|
||||
"version": "2.3.9~ynh1",
|
||||
"version": "2.3.9~ynh2",
|
||||
"url": "https://photoview.github.io/",
|
||||
"license": "AGPL-3.0-only",
|
||||
"maintainer": {
|
||||
|
|
|
@ -15,6 +15,11 @@ fi
|
|||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
function install_dependencies {
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
}
|
||||
|
||||
function setup_sources {
|
||||
ynh_secure_remove "$final_path"
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
|
|
|
@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
|
|||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_setup() {
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
|
@ -80,7 +80,7 @@ ynh_backup --src_path="/var/log/$app"
|
|||
#=================================================
|
||||
ynh_print_info --message="Backing up the MySQL database..."
|
||||
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
ynh_mysql_dump_db --database="$db_name" >db.sql
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -46,7 +46,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma
|
|||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_setup() {
|
||||
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
|
||||
|
@ -61,8 +61,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
|
||||
change_domain=0
|
||||
if [ "$old_domain" != "$new_domain" ]
|
||||
then
|
||||
if [ "$old_domain" != "$new_domain" ]; then
|
||||
change_domain=1
|
||||
fi
|
||||
|
||||
|
@ -85,8 +84,7 @@ ynh_script_progression --message="Updating NGINX web server configuration..." --
|
|||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||
|
||||
# Change the domain for NGINX
|
||||
if [ $change_domain -eq 1 ]
|
||||
then
|
||||
if [ $change_domain -eq 1 ]; then
|
||||
# Delete file checksum for the old conf file location
|
||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||
|
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
|||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_setup() {
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
|
@ -69,8 +69,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=60
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
install_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -178,8 +177,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
|
|||
ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]
|
||||
then
|
||||
if [ $is_public -eq 1 ]; then
|
||||
# Everyone can access the app.
|
||||
# The "main" permission is automatically created before the install script.
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
|
|
|
@ -43,7 +43,7 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
|
|||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config
|
||||
|
||||
I
|
||||
#=================================================
|
||||
# REMOVE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
|
|
@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
|
|||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_setup() {
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
|
@ -42,10 +42,10 @@ mapbox_token=$(ynh_app_setting_get --app=$app --key=mapbox_token)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url ||
|
||||
ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path ||
|
||||
ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
|
@ -70,7 +70,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
ynh_script_progression --message="Reinstalling dependencies..." --weight=30
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
install_dependencies
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
|
@ -100,7 +100,7 @@ ynh_script_progression --message="Restoring the MySQL database..." --weight=1
|
|||
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <./db.sql
|
||||
|
||||
#=================================================
|
||||
# RESTORE GO
|
||||
|
|
|
@ -39,7 +39,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
|
|||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_setup() {
|
||||
# Restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
|
@ -68,14 +68,13 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
install_dependencies
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]; then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=5
|
||||
|
||||
setup_sources
|
||||
|
|
Loading…
Add table
Reference in a new issue