From 540e1acf7597c5b10355214cd8a5c9b9ebdd6456 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 13 Sep 2018 09:53:19 +0200 Subject: [PATCH 1/2] [fix] Use update zip for upgrading Fixes #5 --- conf/app-upgrade.src | 6 ++++++ scripts/upgrade | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 conf/app-upgrade.src diff --git a/conf/app-upgrade.src b/conf/app-upgrade.src new file mode 100644 index 0000000..08afa35 --- /dev/null +++ b/conf/app-upgrade.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.5.1/grav-update-v1.5.1.zip +SOURCE_SUM=D1D1BD1937848F54A707778DCF315EB17D95A3D9094DCC4189F0189C4824FC7C +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= diff --git a/scripts/upgrade b/scripts/upgrade index 8081797..84ec388 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,7 +76,7 @@ path_url=$(ynh_normalize_url_path $path_url) #================================================= # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source "$final_path" +ynh_setup_source "$final_path" "app-upgrade" #================================================= # NGINX CONFIGURATION @@ -131,4 +131,4 @@ fi # RELOAD NGINX #================================================= -systemctl reload nginx \ No newline at end of file +systemctl reload nginx From 1d87c5991bea3549721caaa98d8d28602cf775e9 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 13 Sep 2018 09:56:07 +0200 Subject: [PATCH 2/2] [enh] Comments in upgrade script --- scripts/upgrade | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 84ec388..c054c34 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,15 +67,13 @@ ynh_abort_if_errors # Normalize the URL path syntax path_url=$(ynh_normalize_url_path $path_url) - - #================================================= # STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# Download, check integrity, uncompress and patch the source from app.src +# Download, check integrity, uncompress and patch the source from app-upgrade.src ynh_setup_source "$final_path" "app-upgrade" #================================================= @@ -105,14 +103,13 @@ ynh_system_user_create "$app" # Create a dedicated php-fpm config ynh_add_fpm_config -chown -R "$app": "$final_path" - #================================================= # GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= +chown -R "$app": "$final_path" #================================================= # SETUP SSOWAT