From 53cecfdff563309695e6ceb82297759cbca69717 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 19 Dec 2023 03:17:11 +0100 Subject: [PATCH] Apply nginx workaround for upgrade too --- scripts/change_url | 9 +++++++++ scripts/upgrade | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 3a9b28d..25eb04a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -23,6 +23,15 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 +if [[ "${PACKAGE_CHECK_EXEC:-}" -eq 1 ]] +then + cat << EOF > ../conf/nginx.conf +location / { + return 200 'This is a dummy page for garage, only displayed during tests on Yunohost CI'; +} +EOF +fi + ynh_change_url_nginx_config #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index fd8c553..8be55b1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,6 +45,14 @@ chown -R $app:$app "$install_dir" ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config +if [[ "${PACKAGE_CHECK_EXEC:-}" -eq 1 ]] +then + cat << EOF > ../conf/nginx.conf +location / { + return 200 'This is a dummy page for garage, only displayed during tests on Yunohost CI'; +} +EOF +fi ynh_add_nginx_config ynh_add_config --template="regenconf_nginx_garage" --destination="/usr/share/yunohost/hooks/conf_regen/98-nginx_$app"