Implement fully automated Jenkins HW8 setup with Ansible, JCasC and JJB

This commit is contained in:
2026-04-15 22:56:40 +03:00
parent 9f801e52a4
commit 2aa8a49ee1
46 changed files with 1333 additions and 412 deletions
+19
View File
@@ -0,0 +1,19 @@
FROM eclipse-temurin:21-jre
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
docker.io \
python3 \
python3-pip \
&& pip3 install --break-system-packages --no-cache-dir "setuptools<81" "jenkins-job-builder>=6.4.3" \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL -o /usr/local/bin/swarm-client.jar \
https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/3.51/swarm-client-3.51.jar
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
: "${JENKINS_URL:?JENKINS_URL is required}"
: "${JENKINS_USER:?JENKINS_USER is required}"
: "${JENKINS_PASSWORD:?JENKINS_PASSWORD is required}"
: "${JENKINS_AGENT_NAME:?JENKINS_AGENT_NAME is required}"
exec java -jar /usr/local/bin/swarm-client.jar \
-master "${JENKINS_URL}" \
-username "${JENKINS_USER}" \
-password "${JENKINS_PASSWORD}" \
-name "${JENKINS_AGENT_NAME}" \
-labels "${JENKINS_LABELS:-jjb docker}" \
-executors 1 \
-mode exclusive \
-disableSslVerification