mirror of
https://github.com/YunoHost-Apps/jenkins_ynh.git
synced 2024-09-03 19:26:18 +02:00
47 lines
1.6 KiB
Bash
47 lines
1.6 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# MODIFY JENKINS SETUP
|
|
#=================================================
|
|
ynh_script_progression --message="Updating Jenkins setup..."
|
|
|
|
ynh_replace_string --target_file="/lib/systemd/system/jenkins.service" \
|
|
--match_string="Environment=\"JENKINS_PREFIX=$old_path\"" \
|
|
--replace_string="Environment=\"JENKINS_PREFIX=$new_path\""
|
|
|
|
systemctl daemon-reload --quiet
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting $app's systemd service..." --weight=1
|
|
|
|
# Start a systemd service
|
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app"
|