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

Merge pull request #61 from YunoHost-Apps/yakforms

Yakforms
This commit is contained in:
lapineige 2023-08-13 10:35:56 +02:00 committed by GitHub
commit 3d7a875bcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 28 deletions

View file

@ -19,8 +19,7 @@ Framaforms is an online forms and surveys service. Registered users are allowed
See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les-reponses-que-vous-collectez-a-google/) and this [interview](https://framablog.org/2016/10/05/en-savoir-un-peu-plus-sur-le-projet-framaforms/) (in French) for further informations. See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les-reponses-que-vous-collectez-a-google/) and this [interview](https://framablog.org/2016/10/05/en-savoir-un-peu-plus-sur-le-projet-framaforms/) (in French) for further informations.
**Shipped version:** 1.0.3~ynh3 **Shipped version:** 1.1~ynh1
## Disclaimers / important information ## Disclaimers / important information
## Configuration ## Configuration
@ -29,8 +28,8 @@ You can modify some configurations using the Framaforms administration panel. Yo
## Documentation and resources ## Documentation and resources
* Official app website: <https://framaforms.org> * Official app website: <https://yakforms.org>
* Upstream app code repository: <https://framagit.org/framasoft/framaforms> * Upstream app code repository: <https://framagit.org/yakforms/yakforms>
* YunoHost documentation for this app: <https://yunohost.org/app_framaforms> * YunoHost documentation for this app: <https://yunohost.org/app_framaforms>
* Report a bug: <https://github.com/YunoHost-Apps/framaforms_ynh/issues> * Report a bug: <https://github.com/YunoHost-Apps/framaforms_ynh/issues>

View file

@ -19,8 +19,7 @@ Framaforms is an online forms and surveys service. Registered users are allowed
See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les-reponses-que-vous-collectez-a-google/) and this [interview](https://framablog.org/2016/10/05/en-savoir-un-peu-plus-sur-le-projet-framaforms/) (in French) for further informations. See this [article](https://framablog.org/2016/10/05/framaforms-noffrez-plus-les-reponses-que-vous-collectez-a-google/) and this [interview](https://framablog.org/2016/10/05/en-savoir-un-peu-plus-sur-le-projet-framaforms/) (in French) for further informations.
**Version incluse :** 1.0.3~ynh3 **Version incluse :** 1.1~ynh1
## Avertissements / informations importantes ## Avertissements / informations importantes
## Configuration ## Configuration
@ -29,8 +28,8 @@ You can modify some configurations using the Framaforms administration panel. Yo
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : <https://framaforms.org> * Site officiel de l'app : <https://yakforms.org>
* Dépôt de code officiel de l'app : <https://framagit.org/framasoft/framaforms> * Dépôt de code officiel de l'app : <https://framagit.org/yakforms/yakforms>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_framaforms> * Documentation YunoHost pour cette app : <https://yunohost.org/app_framaforms>
* Signaler un bug : <https://github.com/YunoHost-Apps/framaforms_ynh/issues> * Signaler un bug : <https://github.com/YunoHost-Apps/framaforms_ynh/issues>

View file

@ -6,12 +6,12 @@
"en": "Create online webforms and surveys", "en": "Create online webforms and surveys",
"fr": "Créez des formulaires et questionnaires en ligne" "fr": "Créez des formulaires et questionnaires en ligne"
}, },
"version": "1.0.3~ynh3", "version": "1.1~ynh1",
"url": "https://framaforms.org", "url": "https://yakforms.org",
"upstream": { "upstream": {
"license": "GPL-2.0-only", "license": "GPL-2.0-only",
"website": "https://framaforms.org", "website": "https://yakforms.org",
"code": "https://framagit.org/framasoft/framaforms" "code": "https://framagit.org/yakforms/yakforms"
}, },
"license": "GPL-2.0-only", "license": "GPL-2.0-only",
"maintainer": { "maintainer": {

View file

@ -90,21 +90,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=9
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path/app"
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
@ -141,6 +126,45 @@ chmod 750 "$datadir"
chmod -R o-rwx "$datadir" chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir" chown -R $app:www-data "$datadir"
#=================================================
# Framaforms 2 Yakforms Backup
#=================================================
upgrade_to_yakforms=false
if test -d "$final_path/app/CHANGELOG-FRAMAFORMS.md"
then
update-alternatives --set php /usr/bin/php$phpversion
upgrade_to_yakforms=true
pushd "$final_path"
ynh_exec_as $app env PATH=$PATH php framaforms2yakforms.php backup
ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms
ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms
ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms_share_results
ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms_share_results
ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms_public_results
ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms_public_results
ynh_exec_as $app env PATH=$PATH drush @$app dis framaforms_spam
ynh_exec_as $app env PATH=$PATH drush @$app pm-uninstall framaforms_spam
popd
update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=9
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path/app"
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# UPGRADE COMPOSER # UPGRADE COMPOSER
#================================================= #=================================================
@ -150,10 +174,27 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path/.composer
export PATH="$final_path/.composer/vendor/bin:$PATH" export PATH="$final_path/.composer/vendor/bin:$PATH"
#=================================================
# Framaforms 2 Yakforms Restore
#=================================================
if [ "$upgrade_to_yakforms" = true ]
then
update-alternatives --set php /usr/bin/php$phpversion
pushd "$final_path"
ynh_exec_as $app env PATH=$PATH drush @$app en yakforms
ynh_exec_as $app env PATH=$PATH drush @$app dis yakforms_share_results
ynh_exec_as $app env PATH=$PATH drush @$app dis yakforms_public_results
ynh_exec_as $app env PATH=$PATH drush @$app dis yakforms_spam
ynh_exec_as $app env PATH=$PATH php framaforms2yakforms.php restore
ynh_exec_as $app env PATH=$PATH php framaforms2yakforms.php clean
popd
update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
fi
#================================================= #=================================================
# UPGRADE DRUPAL # UPGRADE DRUPAL
#================================================= #=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading Drupal..." --weight=30 ynh_script_progression --message="Upgrading Drupal..." --weight=30