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

ynh_add_config

This commit is contained in:
yalh76 2021-02-28 10:04:39 +01:00
parent 8cc021813c
commit b390979455
3 changed files with 7 additions and 27 deletions

View file

@ -96,6 +96,8 @@ then
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
# Store file checksum for the new config file location # Store file checksum for the new config file location
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
domain="$new_domain"
path_url="$new_path"
fi fi
#================================================= #=================================================
@ -105,13 +107,7 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Updating Drush alias..." ynh_script_progression --message="Updating Drush alias..."
drush_aliasconfig="$final_path/drush/sites/$app.site.yml" ynh_add_config --template="../conf/example.site.yml" --destination="$final_path/drush/sites/$app.site.yml"
cp -f "../conf/example.site.yml" "$drush_aliasconfig"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$drush_aliasconfig"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION

View file

@ -128,13 +128,7 @@ ynh_add_swap --size=$swap_needed
ynh_script_progression --message="Creating Drush alias..." ynh_script_progression --message="Creating Drush alias..."
mkdir -p "$final_path/drush/sites/" mkdir -p "$final_path/drush/sites/"
drush_aliasconfig="$final_path/drush/sites/$app.site.yml" ynh_add_config --template="../conf/example.site.yml" --destination="$final_path/drush/sites/$app.site.yml"
cp -f "../conf/example.site.yml" "$drush_aliasconfig"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$drush_aliasconfig"
#================================================= #=================================================
# INSTALL COMPOSER # INSTALL COMPOSER
@ -142,9 +136,7 @@ ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --
ynh_script_progression --message="Installing Composer..." ynh_script_progression --message="Installing Composer..."
mkdir -p "$final_path/.composer" mkdir -p "$final_path/.composer"
ynh_add_config --template="../conf/composer.json" --destination="$final_path/composer.json"
cp -f "../conf/composer.json" "$final_path/composer.json"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/composer.json"
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
@ -170,10 +162,7 @@ update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}
#================================================= #=================================================
ynh_script_progression --message="Setuping the cron file..." ynh_script_progression --message="Setuping the cron file..."
cp ../conf/cron /etc/cron.d/$app ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app"
#================================================= #=================================================
# STORE THE CONFIG FILE CHECKSUM # STORE THE CONFIG FILE CHECKSUM

View file

@ -144,12 +144,7 @@ ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php"
#================================================= #=================================================
ynh_script_progression --message="Setuping the cron file" ynh_script_progression --message="Setuping the cron file"
cp -f ../conf/cron /etc/cron.d/$app ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app"
ynh_systemd_action --service_name=cron --action=restart
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION