@@ -149,17 +149,116 @@ In order to debug the controller, use the `-e DEBUG=true -p 5005:5005` when star
149149Jenkins will be suspended on the startup in such case,
150150and then it will be possible to attach a debugger from IDE to it.
151151
152- == Test the publishing using an overridden target repository on Docker Hub
152+ == Test images publication
153153
154- Create a new dedicated target repository in your Docker Hub account, and use it like follows :
154+ You can test the script used for publication in dry-run by setting an existing Jenkins Core version and by passing the `-n` option :
155155
156156[source,bash]
157157--
158- export DOCKERHUB_ORGANISATION=batmat
159- export DOCKERHUB_REPO=test-jenkins
158+ $ export JENKINS_VERSION=2.528.3
159+ $ ./.ci/publish.sh -n
160+ Dry run, will not publish images
161+ Using the following settings:
162+ * JENKINS_REPO: jenkins/jenkins
163+ * JENKINS_VERSION: 2.528.3
164+ * WAR_SHA: bfa31f1e3aacebb5bce3d5076c73df97bf0c0567eeb8d8738f54f6bac48abd74
165+ * COMMIT_SHA: 1c72a9383191562eb3c44838aeeadad0839c2c92
166+ * LATEST_WEEKLY: false
167+ * LATEST_LTS: true
168+ * BUILD_METADATA_PATH: target/build-result-metadata_linux_dry-run.json
169+ [+] Building 104.6s (59/73)
170+ <...snip...>
171+ --
172+
173+ Note that if you can set `BAKE_TARGET` to test the publication of a single target instead the default "linux" multiarch (heavy) build:
174+
175+ [source,bash]
176+ --
177+ $ export BAKE_TARGET=debiand_jdk25
178+ $ ./.ci/publish.sh -n
179+ Using the following settings:
180+ * JENKINS_REPO: jenkins/jenkins
181+ * JENKINS_VERSION: 2.528.3
182+ * WAR_SHA: bfa31f1e3aacebb5bce3d5076c73df97bf0c0567eeb8d8738f54f6bac48abd74
183+ * COMMIT_SHA: aaf4e7faf887b7ac4879c3bf540ede48220cca9f
184+ * LATEST_WEEKLY: false
185+ * LATEST_LTS: true
186+ * BUILD_METADATA_PATH: target/build-result-metadata_debian_jdk25_dry-run.json
187+ * BAKE TARGET: debian_jdk25
188+ * BUILDX OPTIONS:
189+ --pull
190+ --set=*.output=type=cacheonly
191+ --metadata-file=target/build-result-metadata_debian_jdk25_dry-run.json
192+
193+ * RESOLVED BAKE CONFIG:
194+ {
195+ "group": {
196+ "default": {
197+ "targets": [
198+ "debian_jdk25"
199+ ]
200+ }
201+ },
202+ "target": {
203+ "debian_jdk25": {
204+ "context": ".",
205+ "dockerfile": "debian/Dockerfile",
206+ "args": {
207+ "COMMIT_SHA": "aaf4e7faf887b7ac4879c3bf540ede48220cca9f",
208+ "DEBIAN_RELEASE_LINE": "trixie",
209+ "DEBIAN_VARIANT": "",
210+ "DEBIAN_VERSION": "20251117",
211+ "JAVA_VERSION": "25.0.1_8",
212+ "JENKINS_VERSION": "2.528.3",
213+ "PLUGIN_CLI_VERSION": "2.13.2",
214+ "WAR_SHA": "bfa31f1e3aacebb5bce3d5076c73df97bf0c0567eeb8d8738f54f6bac48abd74",
215+ "WAR_URL": "https://get.jenkins.io/war-stable/2.528.3/jenkins.war"
216+ },
217+ "tags": [
218+ "docker.io/jenkins/jenkins:2.528.3-jdk25",
219+ "docker.io/jenkins/jenkins:lts-jdk25",
220+ "docker.io/jenkins/jenkins:2.528.3-lts-jdk25"
221+ ],
222+ "platforms": [
223+ "linux/amd64",
224+ "linux/arm64",
225+ "linux/s390x",
226+ "linux/ppc64le"
227+ ]
228+ }
229+ }
230+ }
231+ [+] Building 104.6s (59/73)
232+ ...
233+ --
234+
235+ You can also pass the `-d` option (debug) to see traces from the script.
236+
237+ === Using an overridden target repository on Docker Hub
238+
239+ Create a new dedicated target repository in your Docker Hub account, and use it like follows (note the absence of `-d` option):
240+
241+ [source,bash]
242+ --
243+ $ export DOCKERHUB_ORGANISATION=jenkins4eval
244+ $ export DOCKERHUB_REPO=test-jenkins
160245# The log below will help confirm this override was taken in account:
161- ./publish.sh
162- Docker repository in Use:
163- * JENKINS_REPO: batmat/test-jenkins
246+ $ ./.ci/publish.sh
247+ Using the following settings:
248+ * JENKINS_REPO: jenkins4eval/test-jenkins
249+ * JENKINS_VERSION: 2.528.3
250+ * WAR_SHA: bfa31f1e3aacebb5bce3d5076c73df97bf0c0567eeb8d8738f54f6bac48abd74
251+ * COMMIT_SHA: aaf4e7faf887b7ac4879c3bf540ede48220cca9f
252+ * LATEST_WEEKLY: false
253+ * LATEST_LTS: true
254+ * BUILD_METADATA_PATH: target/build-result-metadata_linux_publish.json
255+ * BAKE TARGET: linux
256+ * BUILDX OPTIONS:
257+ --pull
258+ --push
259+ --metadata-file=target/build-result-metadata_linux_publish.json
260+
261+ * RESOLVED BAKE CONFIG:
262+ {
164263...
165264--
0 commit comments