From 926553133a8a421b5df12ef67614b07c2081f308 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 1 Mar 2021 21:47:04 +0100 Subject: [PATCH] New configuration mecanism for yunorunner --- conf/systemd.service | 2 +- conf/yunorunner.config.py | 8 ++++++++ scripts/install | 9 ++------- scripts/upgrade | 9 --------- 4 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 conf/yunorunner.config.py diff --git a/conf/systemd.service b/conf/systemd.service index b7736e2..5add09d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Restart=always User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=__FINALPATH__/ve3/bin/python ./run.py /home/CI_package_check/analyseCI.sh --port __PORT__ --base-url https://__DOMAIN____PATH__ +ExecStart=__FINALPATH__/ve3/bin/python ./run.py [Install] WantedBy=multi-user.target diff --git a/conf/yunorunner.config.py b/conf/yunorunner.config.py new file mode 100644 index 0000000..043c915 --- /dev/null +++ b/conf/yunorunner.config.py @@ -0,0 +1,8 @@ +BASE_URL = "https://__DOMAIN____PATH__" +PORT = __PORT__ +DEBUG = False +PATH_TO_ANALYZER = "/home/CI_package_check/analyseCI.sh" +MONITOR_APPS_LIST = False +MONITOR_GIT = False +MONITOR_ONLY_GOOD_QUALITY_APPS = False +MONTHLY_JOBS = False diff --git a/scripts/install b/scripts/install index f989586..40f1674 100644 --- a/scripts/install +++ b/scripts/install @@ -140,15 +140,10 @@ ynh_print_info "Configuring a systemd service..." ynh_add_systemd_config #================================================= -# CHANGE PORT IN YUNORUNNER +# CONFIGURE YUNORUNNER #================================================= -ynh_replace_string "__DOMAIN__" "$domain" "/etc/systemd/system/$app.service" -ynh_replace_string "__PATH__" "$path_url" "/etc/systemd/system/$app.service" -ynh_replace_string "__PORT__" "$port" "/etc/systemd/system/$app.service" -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum "/etc/systemd/system/$app.service" -systemctl daemon-reload +ynh_add_config --template="yunorunner.config.py" --destination="$final_path/config.py" #================================================= # GENERIC FINALISATION diff --git a/scripts/upgrade b/scripts/upgrade index 932e26f..6007b76 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -119,15 +119,6 @@ ynh_system_user_create $app #================================================= ynh_add_systemd_config -echo -e "\e[93m\e[1m[WARN]\e[0m Please have a look to the diff of your systemd conf file. The upgrade could have broken this CI." >&2 - -#================================================= -# CHANGE PORT IN YUNORUNNER -#================================================= - -ynh_replace_string "__PORT__" "$port" "/etc/systemd/system/$app.service" -ynh_store_file_checksum "/etc/systemd/system/$app.service" -systemctl daemon-reload #================================================= # Fix current websocket version error (2019-02-14)