From af9c8774d3c8df7c3baec6b5585ca4fc4c87aaf9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 1 Jun 2019 06:51:06 +0200 Subject: [PATCH 1/5] backup config before modifying it --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index d5501d4..5462c41 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -134,6 +134,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= config="$final_path/$app/.env" +ynh_backup_if_checksum_is_different --file="$config" cp ../conf/.env "$config" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" @@ -183,7 +184,6 @@ popd # STORE THE CONFIG FILE CHECKSUM #================================================= -ynh_backup_if_checksum_is_different --file="$config" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$config" From 5c2a46e83b36ac69c7e89f3e0ca3d27987dcc6c3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 13 Jun 2019 23:51:40 +0200 Subject: [PATCH 2/5] Update pull_request_template.md --- pull_request_template.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pull_request_template.md b/pull_request_template.md index eac40c3..6e38f27 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -11,13 +11,8 @@ - [ ] Upgrade from last version tested. - [ ] Can be reviewed and tested. -## Validation +## Package_check results --- -- [ ] **Code review** -- [ ] **Approval (LGTM)** -*Code review and approval have to be from a member of @YunoHost/apps group* -- **CI succeeded** : -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/mobilizon_ynh%20-BRANCH-/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/mobilizon_ynh%20-BRANCH-/) -*Please replace '-BRANCH-' in this link by the name of the branch used.* -*If the PR is from a forked repository. Please provide public results from package_check.* -When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. +*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* + +[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/mobilizon_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/mobilizon_ynh%20PR-NUM-%20(USERNAME)/) From 4848118e19982c29589bbf6f5af1b66927638568 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 15 Jun 2019 00:14:11 +0200 Subject: [PATCH 3/5] Upgrade to 0.1.0-2019-06-14 --- README.md | 2 +- conf/app.src | 6 +++--- manifest.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 97c6605..6ccac08 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ MobiliZon aims to solve existing platform's problems to organize events in a dec Mobilizon is a tool designed to create platforms for managing communities and events. Its purpose is to help as many people as possible to free themselves from Facebook groups and events, from Meetup, etc. -**Shipped version:** 0.1.0-2019-05-15 +**Shipped version:** 0.1.0-2019-06-14 ## Important diff --git a/conf/app.src b/conf/app.src index 3423c7e..0fb3aca 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/c53f19dc04cdbdfc23f654daa489be28e18ff7f1/mobilizon-c53f19dc04cdbdfc23f654daa489be28e18ff7f1.tar.gz -SOURCE_SUM=27e8f0a5fecd71e7531cec794870cefb23a8692fe2ed9463c272fbb05481292f +SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1f0d125d6f488cca1a4dd9ba59efe1584dc9eb02/mobilizon-1f0d125d6f488cca1a4dd9ba59efe1584dc9eb02.tar.gz +SOURCE_SUM=66ed172914e365b0a422cd6bdfd2d8803900bfd320ac2717039a44bc7a660fd0 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= +SOURCE_FILENAME= \ No newline at end of file diff --git a/manifest.json b/manifest.json index c8dcdfa..aee4d0e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Your federated organization and mobilization platform.", "fr": "Votre plateforme fédérée d'organisation et de mobilisation." }, - "version": "0.1.0-2019-05-15~ynh1", + "version": "0.1.0-2019-06-14~ynh1", "url": "https://joinmobilizon.org/", "license": "AGPL-3.0-or-later", "maintainer": { From c173ad82f98ca5190c29b6f7fe0e98534b61e4f8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 16 Jun 2019 16:02:47 +0200 Subject: [PATCH 4/5] Update check_process --- check_process | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/check_process b/check_process index 95d7e02..a195ceb 100644 --- a/check_process +++ b/check_process @@ -15,24 +15,16 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=185cc16e516076e340cca149e8e9140a8762e22e backup_restore=1 multi_instance=1 - incorrect_path=0 + # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. + # incorrect_path=1 port_already_use=0 change_url=0 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto -# Level 4: If the app supports LDAP and SSOwat, turn level 4 to '1' and add a link to an issue or a part of your code to show it. -# If the app does not use LDAP nor SSOwat, and can't use them, turn level 4 to 'na' and explain as well. - Level 4=0 + # If the level 5 (Package linter) is forced to 1. Please add justifications here. Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 ;;; Options Email=yalh@yahoo.com Notification=all From a8412585860efd8fa30fa4d8970d036762ae29ca Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 22 Jun 2019 09:07:19 +0200 Subject: [PATCH 5/5] Fix upgrade steps --- scripts/upgrade | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 5462c41..64dc9d8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,6 +71,7 @@ ynh_print_info --message="Backing up the app before upgrading (may take a while) # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + read -p "key" # restore it if the upgrade fails ynh_restore_upgradebackup ynh_clean_check_starting @@ -94,9 +95,26 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --time --weight=1 + + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/$app/.env" "$tmpdir/.env" + cp -a "$final_path/$app/config/prod.exs" "$tmpdir/prod.exs" + + # Remove the app directory securely + ynh_secure_remove --file="$final_path/$app" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path/$app" + + #Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/.env" "$final_path/$app/.env" + cp -a "$tmpdir/prod.exs" "$final_path/$app/config/prod.exs" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi #=================================================