Skip to content

Commit b406e69

Browse files
authored
Merge branch 'jenkins-docs:main' into main
2 parents 96912e3 + a75cc24 commit b406e69

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ updates:
4242
directory: "./dockerfiles/sidekick"
4343
schedule:
4444
interval: weekly
45-
open-pull-requests-limit: 10
45+
open-pull-requests-limit: 10
46+
- package-ecosystem: docker
47+
directory: "./dockerfiles/agent-discovery"
48+
schedule:
49+
interval: weekly
50+
open-pull-requests-limit: 10
4651
- package-ecosystem: docker
4752
directory: "./dockerfiles/android"
4853
schedule:
@@ -52,4 +57,4 @@ updates:
5257
directory: "./dockerfiles/golang"
5358
schedule:
5459
interval: weekly
55-
open-pull-requests-limit: 10
60+
open-pull-requests-limit: 10

docker-compose.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ services:
5959
- python
6060
- node
6161
- android
62-
- multi
6362
- golang
6463
- default
6564
# The CASC_RELOAD_TOKEN environment variable is used by the Jenkins controller to restart the Configuration as Code (JCasc) plugin configuration.

dockerfiles/agent-discovery/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile is used to prepare a Debian-based Docker image with several utilities installed.
22

33
# We start from the Debian 'bookworm' image dated 2023-11-20.
4-
FROM debian:bookworm-20240311-slim as prepare-stage
4+
FROM debian:bookworm-20241111-slim as prepare-stage
55

66
# Copy all shell scripts from the current directory to /usr/local/bin/ in the image.
77
COPY *sh /usr/local/bin/

dockerfiles/agent-discovery/find-name.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,31 @@ while true; do
7979
sleep 2 # Wait for 5 seconds before the next iteration of the loop.
8080
done
8181

82+
# Check if jenkins_controller is reachable, otherwise fall back to multi_jenkins_controller
83+
JENKINS_CONTROLLER="jenkins_controller"
84+
if ! curl -s -f "http://${JENKINS_CONTROLLER}:8080/login" > /dev/null; then
85+
echo "Primary controller not reachable, falling back to multi controller..."
86+
JENKINS_CONTROLLER="multi_jenkins_controller"
87+
if ! curl -s -f "http://${JENKINS_CONTROLLER}:8080/login" > /dev/null; then
88+
echo "Error: Neither primary nor multi controller is reachable"
89+
exit 1
90+
fi
91+
fi
92+
8293
# Check If Jenkins is running or not
8394
# If the message is found, awk exits with a non-zero status (1), and the loop continues.
8495
# 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"
101+
86102
echo "Jenkins is ready"
87103
# Get the Jenkins version
88-
JENKINS_VERSION=$(curl -s -I -k http://admin:admin@jenkins_controller:8080 | grep -i '^X-Jenkins:' | awk '{print $2}')
104+
JENKINS_VERSION=$(curl -s -I -k http://admin:admin@$JENKINS_CONTROLLER:8080 | grep -i '^X-Jenkins:' | awk '{print $2}')
89105
echo "Jenkins version is: $JENKINS_VERSION"
90106

91107
# Use the token in the curl command to reload the configuration
92-
# curl -X POST "http://admin:admin@jenkins_controller:8080/reload-configuration-as-code/?casc-reload-token=$JCASC_TOKEN"
93-
curl -X POST "http://admin:admin@jenkins_controller:8080/reload-configuration-as-code/?casc-reload-token=thisisnotsecure"
108+
# curl -X POST "http://admin:admin@$JENKINS_CONTROLLER:8080/reload-configuration-as-code/?casc-reload-token=$JCASC_TOKEN"
109+
curl -X POST "http://admin:admin@$JENKINS_CONTROLLER:8080/reload-configuration-as-code/?casc-reload-token=thisisnotsecure"

dockerfiles/plugins.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@ workflow-job:1468.vcf4f5ee92395
7878
workflow-multibranch:795.ve0cb_1f45ca_9a_
7979
workflow-scm-step:427.v4ca_6512e7df1
8080
workflow-step-api:678.v3ee58b_469476
81-
workflow-support:932.vb_555de1b_a_b_94
81+
workflow-support:936.v9fa_77211ca_e1
8282
ws-cleanup:0.48

0 commit comments

Comments
 (0)