From 2dc13b7e842c5cab06daaa54010ce14b29d7381f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Mon, 18 Mar 2019 08:23:53 +0100 Subject: [PATCH] Trying to pass package_check --- scripts/_common.sh | 29 ++++++++++++++--------------- scripts/change_url | 10 ++++++++-- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4c4f822..151c691 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -137,17 +137,17 @@ gitlab_ctl_action() { local action=${action:-start} local timeout=${timeout:-300} - # Start to read the log - local templog="$(mktemp)" - # Read the specified log file - tail -F -n0 "$log_path" > "$templog" 2>&1 & - # Get the PID of the tail command - local pid_tail=$! - ynh_print_info --message="${action^} gitlab" gitlab-ctl $action + # Start to read the log + local templog="$(mktemp)" + # Read the specified log file + tail -F -n1 "$log_path" > "$templog" 2>&1 & + # Get the PID of the tail command + local pid_tail=$! + # Start the timeout and try to find line_match_new or line_match_existing local i=0 for i in $(seq 1 $timeout) @@ -168,17 +168,16 @@ gitlab_ctl_action() { ynh_print_warn "Error during ${action}ing, reconfiguring and restarting gitlab" ynh_clean_check_starting - # Start to read the log - local templog="$(mktemp)" - # Read the specified log file - tail -F -n0 "$log_path" > "$templog" 2>&1 & - # Get the PID of the tail command - local pid_tail=$! - gitlab-ctl reconfigure - gitlab-ctl restart # Force restart unicorn gitlab-ctl restart unicorn + + # Start to read the log + local templog="$(mktemp)" + # Read the specified log file + tail -F -n1 "$log_path" > "$templog" 2>&1 & + # Get the PID of the tail command + local pid_tail=$! fi if [ $i -eq 3 ]; then echo -n "Please wait, Gitlab is ${action}ing" >&2 diff --git a/scripts/change_url b/scripts/change_url index 26041c9..e6b8846 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -105,6 +105,9 @@ mkdir -p $config_path cp -f ../conf/gitlab.rb "$config_path/gitlab.rb" +domain="$new_domain" +path_url="$new_path" + ynh_replace_string "__GENERATED_EXTERNAL_URL__" "https://$domain${path_url%/}" "$config_path/gitlab.rb" ynh_replace_string "__PORT__" "$port" "$config_path/gitlab.rb" ynh_replace_string "__PORTUNICORN__" "$portUnicorn" "$config_path/gitlab.rb" @@ -115,9 +118,12 @@ ynh_store_file_checksum "$config_path/gitlab.rb" # RECONFIGURE GITLAB #================================================= -gitlab-ctl reconfigure +gitlab_ctl_action --action=reconfigure --timeout=3600 -gitlab_ctl_action --action=restart --timeout=3600 +if [ $change_path -eq 1 ]; then + gitlab-ctl restart + gitlab_ctl_action --action="restart unicorn" --timeout=3600 +fi #================================================= # GENERIC FINALISATION