1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

upgrade script to allox old version upgrade, upgrade pull_request_template (new package check process, add local curl to finalise upgrade

This commit is contained in:
BenoitCier 2021-03-31 13:44:55 +02:00
parent 696d4be07d
commit a5bba52e1a
5 changed files with 56 additions and 10 deletions

6
conf/0.8.5.src Normal file
View file

@ -0,0 +1,6 @@
SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.8.5.tar.bz2
SOURCE_SUM=6cd90b806b35386e4d5be98e2db26ca3dbbd32a74538bedefcd9fbad0bfc8d5a
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.bz2
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=

6
conf/0.9.8.src Normal file
View file

@ -0,0 +1,6 @@
SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.8.1.tar.bz2
SOURCE_SUM=7cc64b51c9721c2dd7ee510f245bcfc4693ee07f74581ad74003906eb4716ef1
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.bz2
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=

View file

@ -6,7 +6,7 @@
"en": "Software to manage association",
"fr": "Logiciel libre de gestion d'association"
},
"version": "1.0.7~ynh1",
"version": "1.0.7~ynh2",
"url": "http://garradin.eu/a-propos/",
"license": "GPL-3.0-or-later",
"maintainer": {

View file

@ -11,8 +11,3 @@
- [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested.
## Package_check results
---
*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/garradin_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -24,11 +24,14 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK VERSION
#=================================================
if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then
ynh_print_info --message="Sorry your version is outdated and need first an update to version 0.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and open your admin page to finalize before next update"
ynh_die "Sorry your version is outdated and need first an update to version 0.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and open your admin page to finalize before next update"
if ynh_compare_current_package_version --comparison lt --version 0.8.5~ynh1; then
upgrade_type="0.8.5"
else
upgrade_type=$(ynh_check_app_version_changed)
if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then
upgrade_type="0.9.8"
else
upgrade_type=$(ynh_check_app_version_changed)
fi
fi
#=================================================
@ -72,11 +75,47 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# UPGRADE TO 0.8.5 if necessary
#=================================================
if [ "$upgrade_type" == "0.8.5" ]
then
ynh_script_progression --message="Upgrading upgrade to 0.8.5" --weight=5
# Download, check integrity, uncompress and patch the source from 0.8.5.src
ynh_setup_source --dest_dir="$final_path" --source_id="0.8.5"
ynh_add_nginx_config
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
ynh_systemd_action --service_name=nginx --action=reload
#finalyse upgrade
ynh_local_curl "/admin/index.php"
upgrade_type="0.9.8"
fi
#=================================================
# UPGRADE TO 0.9.8 if necessary
#=================================================
if [ "$upgrade_type" == "0.9.8" ]
then
ynh_script_progression --message="Upgrading upgrade to 0.9.8" --weight=5
# Download, check integrity, uncompress and patch the source from 0.9.8.src
ynh_setup_source --dest_dir="$final_path" --source_id="0.9.8"
ynh_add_nginx_config
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
ynh_systemd_action --service_name=nginx --action=reload
#finalyse upgrade
ynh_local_curl "/admin/index.php"
upgrade_type="UPGRADE_APP"
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=5
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
# Download, check integrity, uncompress and patch the source from app.src