1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jenkins_ynh.git synced 2024-09-03 19:26:18 +02:00

Update change_url

This commit is contained in:
yalh76 2022-05-26 00:32:32 +02:00
parent 2a8da1c055
commit 6534ba3ee4

View file

@ -39,6 +39,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# 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"
@ -109,28 +110,8 @@ fi
#=================================================
ynh_script_progression --message="Updating Jenkins setup..."
ynh_backup_if_checksum_is_different --file="/etc/default/jenkins"
if [ $change_path -eq 1 ]
then
# Add the path, in case of sub-path installation, into jenkins' boot options
# Change to root
if [ "$new_path" == "/" ]
then
sed -i "s@--prefix=$old_path@@g" /etc/default/jenkins
# Change to a sub path
else
if ! grep --quiet "prefix=$old_path" /etc/default/jenkins
then
sed -i "$ s@--httpPort=\$HTTP_PORT@& --prefix=$new_path@g" /etc/default/jenkins
else
sed -i "s@--prefix=$old_path@--prefix=$new_path@g" /etc/default/jenkins
fi
fi
fi
ynh_store_file_checksum --file="/etc/default/jenkins"
ynh_replace_string --match_string="Environment=\"JENKINS_PREFIX=$old_path\"" --replace_string="Environment=\"JENKINS_PREFIX=$new_path\"" --target_file="/lib/systemd/system/jenkins.service"
systemctl daemon-reload --quiet
#=================================================
# GENERIC FINALISATION