From 75de5c6b4273b3fb6cfcf74685340e32b3d4beef Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 9 Dec 2022 18:47:56 +0100 Subject: [PATCH] Change upstream to Yakforms, handle migration. --- README.md | 4 ++-- README_fr.md | 4 ++-- conf/extra_php-fpm.conf | 0 manifest.toml | 4 ++-- scripts/upgrade | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 conf/extra_php-fpm.conf diff --git a/README.md b/README.md index a5f2916..1fc0f61 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les- **Shipped version:** 1.0.3~ynh4 ## Documentation and resources -- Official app website: -- Upstream app code repository: +- Official app website: +- Upstream app code repository: - YunoHost Store: - Report a bug: diff --git a/README_fr.md b/README_fr.md index 1b78e37..5855b78 100644 --- a/README_fr.md +++ b/README_fr.md @@ -22,8 +22,8 @@ See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les- **Version incluse :** 1.0.3~ynh4 ## Documentations et ressources -- Site officiel de l’app : -- Dépôt de code officiel de l’app : +- Site officiel de l’app : +- Dépôt de code officiel de l’app : - YunoHost Store : - Signaler un bug : diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..e69de29 diff --git a/manifest.toml b/manifest.toml index 823181f..9f9e2c6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,8 +13,8 @@ maintainers = [] [upstream] license = "GPL-2.0-only" -website = "https://framaforms.org" -code = "https://framagit.org/framasoft/framaforms" +website = "https://yakforms.org" +code = "https://framagit.org/yakforms/yakforms" fund = "https://soutenir.framasoft.org" [integration] diff --git a/scripts/upgrade b/scripts/upgrade index 7e8df4d..b56632f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,6 +12,25 @@ source /usr/share/yunohost/helpers #================================================= # ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +#================================================= +# Framaforms 2 Yakforms Backup +#================================================= +upgrade_to_yakforms=true + +if [ "$upgrade_to_yakforms" = false ]; then + pushd "$install_dir" + ynh_exec_as "$app" env "PATH=$PATH" "php$phpversion" framaforms2yakforms.php backup + _ynh_exec_with_drush_php drush "@$app" dis framaforms + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms + _ynh_exec_with_drush_php drush "@$app" dis framaforms_share_results + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms_share_results + _ynh_exec_with_drush_php drush "@$app" dis framaforms_public_results + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms_public_results + _ynh_exec_with_drush_php drush "@$app" dis framaforms_spam + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms_spam + popd +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -33,6 +52,21 @@ ynh_script_progression --message="Upgrading Composer..." --weight=3 ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir/.composer" +#================================================= +# Framaforms 2 Yakforms Restore +#================================================= + +if [ "$upgrade_to_yakforms" = true ]; then + pushd "$install_dir" + _ynh_exec_with_drush_php drush "@$app" en yakforms + _ynh_exec_with_drush_php drush "@$app" dis yakforms_share_results + _ynh_exec_with_drush_php drush "@$app" dis yakforms_public_results + _ynh_exec_with_drush_php drush "@$app" dis yakforms_spam + ynh_exec_as "$app" env "PATH=$PATH" "php$phpversion" framaforms2yakforms.php restore + ynh_exec_as "$app" env "PATH=$PATH" "php$phpversion" framaforms2yakforms.php clean + popd +fi + #================================================= # UPGRADE DRUPAL #=================================================