mirror of
https://github.com/YunoHost-Apps/pagure_ynh.git
synced 2024-09-03 19:56:19 +02:00
57 lines
2 KiB
Bash
57 lines
2 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source ynh_redis
|
|
source ynh_uwsgi_service__2
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
|
|
|
for service in "${services[@]}"; do
|
|
ynh_systemd_action --service_name="${app}_${service}" --action="stop" --log_path="systemd"
|
|
done
|
|
ynh_systemd_action --service_name="uwsgi-app@$app.service" --action="stop" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# UPDATE A CONFIG FILE
|
|
#=================================================
|
|
ynh_script_progression --message="Updating a configuration file..."
|
|
|
|
ynh_add_config --template="pagure.cfg.sample" --destination="$install_dir/pagure.cfg"
|
|
|
|
chmod 400 "$install_dir/pagure.cfg"
|
|
chown "$app:$app" "$install_dir/pagure.cfg"
|
|
|
|
ynh_add_config --template="pagure.wsgi" --destination="$install_dir/pagure.wsgi"
|
|
ynh_add_uwsgi_service --service="$app" --template="uwsgi.ini"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..."
|
|
|
|
# Start a systemd service
|
|
for service in "${services[@]}"; do
|
|
ynh_systemd_action --service_name="${app}_${service}" --action="start" --log_path="systemd" --line_match="ready"
|
|
done
|
|
ynh_systemd_action --service_name="uwsgi-app@$app.service" --action="start" --log_path="systemd"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app"
|