You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(docker): Multi does not launch a second Jenkins controller anymore. (#792)
* fix(docker): Multi does not launch a second Jenkins controller anymore.
* fix(docker): The single quotes prevent $JENKINS_CONTROLLER from being expanded.
* fix(docker): Improve the fallback mechanism implementation.
* fix(docker): Adding error handling for when both controllers are unreachable.
And making the timeout duration configurable.
* fix(ga): Follows the official documentation for the action
https://github.com/docker/login-action?tab=readme-ov-file#github-container-registry
echo"Error: Neither primary nor multi controller is reachable"
89
+
exit 1
90
+
fi
91
+
fi
92
+
82
93
# Check If Jenkins is running or not
83
94
# If the message is found, awk exits with a non-zero status (1), and the loop continues.
84
95
# If the message is not found, the loop exits, and the "Jenkins is running" message is displayed.
85
-
timeout 60 bash -c 'until curl -s -f http://jenkins_controller:8080/login > /dev/null; do sleep 5; done'&&echo"Jenkins is running"||echo"Jenkins is not running"
96
+
timeout 60 bash -c "until curl -s -f http://${JENKINS_CONTROLLER}:8080/login > /dev/null; do sleep 5; done"&&echo"Jenkins is running"||echo"Jenkins is not running"
97
+
# The colon (:) is a no-op command in Bash, which means it does nothing and always returns a true exit status. It is often used as a placeholder or to evaluate expressions without executing any commands.
98
+
# The ${JENKINS_STARTUP_TIMEOUT:=60} part is a parameter expansion. It checks if the JENKINS_STARTUP_TIMEOUT variable is set and not null. If it is not set, it assigns the value 60 to JENKINS_STARTUP_TIMEOUT
99
+
:"${JENKINS_STARTUP_TIMEOUT:=60}"# Default to 60 seconds if not set
100
+
timeout "${JENKINS_STARTUP_TIMEOUT}" bash -c "until curl -s -f http://${JENKINS_CONTROLLER}:8080/login > /dev/null; do sleep 5; done"&&echo"Jenkins is running"||echo"Jenkins is not running"
0 commit comments