1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

Switching to ynh_add_config

This commit is contained in:
yalh76 2021-02-15 20:52:47 +01:00
parent e9e29f7e89
commit 5b89e157c1
2 changed files with 4 additions and 38 deletions

View file

@ -143,24 +143,7 @@ ynh_add_supervisor_config --service="${app}-horizon" --template=horizon.conf --o
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Modifying a config file..."
config="$final_path/.env" ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
cp ../conf/.env "$config"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"
ynh_replace_string --match_string="__APP_KEY__" --replace_string="$app_key" --target_file="$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$config"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$config"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_script_progression --message="Storing the config file checksum..."
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$config"
#================================================= #=================================================
# DEPLOY # DEPLOY
@ -186,9 +169,7 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Installing the cron file..." ynh_script_progression --message="Installing 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="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -186,20 +186,7 @@ ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$fina
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Modifying a config file..."
config="$final_path/.env" ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
ynh_backup_if_checksum_is_different --file="$config"
cp ../conf/.env "$config"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"
ynh_replace_string --match_string="__APP_KEY__" --replace_string="$app_key" --target_file="$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$config"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$config"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config"
#================================================= #=================================================
# DEPLOYMENT # DEPLOYMENT
@ -235,9 +222,7 @@ chown -R root: "/var/log/$app/"
#================================================= #=================================================
ynh_script_progression --message="Upgrading cron file..." ynh_script_progression --message="Upgrading 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="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app"
#================================================= #=================================================
# SETUP SUPERVISOR # SETUP SUPERVISOR