mirror of
https://github.com/YunoHost-Apps/drupal7_ynh.git
synced 2024-09-03 18:26:19 +02:00
Apply example_ynh
Apply example_ynh
This commit is contained in:
commit
dfdd5a1415
8 changed files with 40 additions and 4 deletions
|
@ -31,7 +31,6 @@ LDAP module can be installed
|
|||
|
||||
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/drupal7%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/drupal7/)
|
||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/drupal7%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/drupal7/)
|
||||
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/drupal7%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/drupal7/)
|
||||
|
||||
## Links
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ le module d'authentification LDAP peut être installé
|
|||
|
||||
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/drupal7%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/drupal7/)
|
||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/drupal7%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/drupal7/)
|
||||
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/drupal7%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/drupal7/)
|
||||
|
||||
## Liens
|
||||
|
||||
|
|
|
@ -13,7 +13,11 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
ynh_print_info --message="Managing script failure..."
|
||||
|
||||
ynh_clean_setup () {
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
ynh_print_info --message="Retrieve arguments from the manifest"
|
||||
|
||||
old_domain=$YNH_APP_OLD_DOMAIN
|
||||
old_path=$YNH_APP_OLD_PATH
|
||||
|
@ -34,6 +35,23 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
#db_user=$db_name
|
||||
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_print_info --message="Backing up the app before changing its url (may take a while)..."
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||
#=================================================
|
||||
|
|
|
@ -15,13 +15,18 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
ynh_print_info --message="Managing script failure..."
|
||||
|
||||
ynh_clean_setup () {
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
#=================================================
|
||||
ynh_print_info --message="Retrieving arguments from the manifest..."
|
||||
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url=$YNH_APP_ARG_PATH
|
||||
|
@ -30,7 +35,6 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
|
|||
language=$YNH_APP_ARG_LANGUAGE
|
||||
password=$YNH_APP_ARG_PASSWORD
|
||||
install_profil=$YNH_APP_ARG_INSTALL_PROFIL
|
||||
|
||||
admin_mail=$(ynh_user_get_info --username=$admin --key="mail")
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
@ -179,6 +183,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil
|
|||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
ynh_print_info --message="Storing the config file checksum..."
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php"
|
||||
|
@ -196,6 +201,7 @@ ynh_add_fpm_config --phpversion="7.2"
|
|||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_print_info --message="Securing files and directories..."
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
|
|
|
@ -15,7 +15,11 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
ynh_print_info --message="Managing script failure..."
|
||||
|
||||
ynh_clean_setup () {
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
|
@ -47,6 +51,7 @@ test ! -d $final_path \
|
|||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_print_info --message="Restoring the nginx configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
|
@ -68,6 +73,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
ynh_print_info --message="Restoring user rights..."
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app: $final_path
|
||||
|
@ -82,6 +88,7 @@ ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
|
|||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_print_info --message="Restoring PHP-FPM configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf"
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
|||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
ynh_print_info --message="Checking version..."
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
|
@ -145,6 +146,7 @@ update-alternatives --set php /usr/bin/php7.0
|
|||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
ynh_print_info --message="Storing the config file checksum..."
|
||||
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php"
|
||||
|
@ -166,6 +168,7 @@ ynh_systemd_action --service_name=cron --action=restart
|
|||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_print_info --message="Securing files and directories..."
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R $app: $final_path
|
||||
|
|
|
@ -41,7 +41,7 @@ ynh_install_php () {
|
|||
ynh_pin_repo --package="*" --pin="origin \"packages.sury.org\"" 200 --name=extra_php_version
|
||||
ynh_pin_repo --package="php7.0*" --pin="origin \"packages.sury.org\"" 600 --name=extra_php_version --append
|
||||
|
||||
# Advertise service in admin panel
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
yunohost service add php${phpversion}-fpm --log "/var/log/php${phpversion}-fpm.log"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue