1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/drupal_ynh.git synced 2024-09-03 18:35:53 +02:00

Use DRUSH_PHP environment variable for drush

This commit is contained in:
Salamandar 2024-01-12 10:38:07 +01:00
parent d19f037abe
commit 0bdae7bcac
3 changed files with 18 additions and 19 deletions

View file

@ -12,6 +12,12 @@ swap_needed=512
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================
_ynh_exec_with_drush_php() {
ynh_exec_warn_less ynh_exec_as "$app" \
env PATH="$PATH" DRUSH_PHP="/usr/bin/php$phpversion" \
"$@"
}
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================

View file

@ -80,20 +80,17 @@ chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
pushd "$install_dir" pushd "$install_dir"
ynh_exec_warn_less ynh_exec_as $app \ _ynh_exec_with_drush_php \
env PATH=$PATH \ drush site:install "$install_profil" \
drush site:install $install_profil \ --account-name="$admin" \
--account-name=$admin \ --account-pass="$password" \
--account-pass=$password \ --account-mail="$admin_mail" \
--account-mail=$admin_mail \ --db-url="mysql://$db_user:$db_pwd@localhost/$db_name" \
--db-url=mysql://$db_user:$db_pwd@localhost/$db_name \
--site-name="$app" \ --site-name="$app" \
--locale=$language \ --locale=$language \
--yes --yes
popd popd
update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
#================================================= #=================================================
# SETUP THE CRON FILE # SETUP THE CRON FILE
#================================================= #=================================================

View file

@ -75,19 +75,15 @@ ynh_backup_if_checksum_is_different --file="$install_dir/$app/sites/default/sett
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
update-alternatives --set php /usr/bin/php$phpversion
pushd "$install_dir" pushd "$install_dir"
ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 1 --input-format=integer _ynh_exec_with_drush_php drush "@$app.prod" state:set system.maintenance_mode 1 --input-format=integer
ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH php composer.phar update drupal/core webflo/drupal-core-require-dev --with-dependencies _ynh_exec_with_drush_php php composer.phar update drupal/core webflo/drupal-core-require-dev --with-dependencies
ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH php composer.phar update --with-dependencies _ynh_exec_with_drush_php php composer.phar update --with-dependencies
ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app.prod -y updatedb _ynh_exec_with_drush_php drush "@$app.prod" -y updatedb
ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app.prod cache:rebuild _ynh_exec_with_drush_php drush "@$app.prod" cache:rebuild
ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 0 --input-format=integer _ynh_exec_with_drush_php drush "@$app.prod" state:set system.maintenance_mode 0 --input-format=integer
popd popd
update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
#================================================= #=================================================
# STORE THE CONFIG FILE CHECKSUM # STORE THE CONFIG FILE CHECKSUM
#================================================= #=================================================