Skip to content
91 changes: 91 additions & 0 deletions updatecli/updatecli.d/jenkins-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
name: Bump default `JENKINS_VERSION` version

scms:
default:
kind: github
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"

sources:
latestVersion:
kind: githubrelease
name: Get latest Jenkins Core release version
spec:
owner: jenkinsci
repository: jenkins
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: regex
pattern: >-
\d+\.\d+$
transformers:
- trimprefix: "jenkins-"
latestWarSha:
kind: shell
name: Get latest Jenkins Core sha256 checksum
spec:
command: curl --disable --fail --silent --show-error --location "https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/{{ source "latestVersion" }}/jenkins-war-{{ source "latestVersion" }}.war.sha256"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
command: curl --disable --fail --silent --show-error --location "https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/{{ source "latestVersion" }}/jenkins-war-{{ source "latestVersion" }}.war.sha256"
command: gh release view "jenkins-{{ source "latestVersion" }}" --repo jenkinsci/jenkins --json assets --jq '.assets[] | select(.name == "jenkins.war").digest' | sed 's/sha256://'

FWIW, I had the command above in my first draft, replaced to use the same as in

WAR_SHA="$(curl --disable --fail --silent --show-error --location "https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war.sha256")"
even if in that case it's more about the Core GH release as signal than the availability of the sha256 from JFrog artifactory, not really in the dependency path of the resulting update.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://updates.jenkins.io/latestCore.txt is the official method of getting the latest core version

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in 4347b7e


conditions:
isDockerImagePublished:
name: Check if the docker image has been published
kind: dockerimage
sourceid: latestVersion
spec:
image: jenkins/jenkins

targets:
updateJenkinsVersionInDockerBake:
name: Update default value of JENKINS_VERSION in docker-bake.hcl
kind: hcl
sourceid: latestVersion
spec:
file: docker-bake.hcl
path: variable.JENKINS_VERSION.default
updateJenkinsVersionInDockerfiles:
name: Update value of JENKINS_VERSION in Dockerfile
kind: dockerfile
sourceid: latestVersion
spec:
files:
- alpine/hotspot/Dockerfile
- debian/Dockerfile
- rhel/Dockerfile
- windows/windowsservercore/hotspot/Dockerfile
instruction:
keyword: ARG
matcher: JENKINS_VERSION
updateJenkinsVersionInGoldenFiles:
kind: file
sourceid: latestVersion
name: Update value of JENKINS_VERSION in (weekly) golden files
spec:
files:
- tests/golden/expected_tags.txt
- tests/golden/expected_tags_latest_weekly.txt
Comment on lines +63 to +64
Copy link
Member Author

@lemeurherve lemeurherve Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: no update for the LTS golden file, as it now properly uses the simulated LTS JENKINS_VERSION and not the default JENKINS_VERSION.

The update of this LTS golden file is done with #2172

Ref:

matchpattern: (\d+\.\d+)
updateWarShaInDockerBake:
name: Update default value of WAR_SHA in docker-bake.hcl
kind: hcl
sourceid: latestWarSha
spec:
file: docker-bake.hcl
path: variable.WAR_SHA.default

actions:
default:
kind: github/pullrequest
title: Bump default `JENKINS_VERSION` to {{ source "latestVersion" }}
scmid: default
spec:
labels:
- dependencies
- jenkins-version