Skip to content

Commit 14f933d

Browse files
authored
chore(updatecli): keep simulated LTS JENKINS_VERSION and WAR_SHA up to date (#2172)
* chore: keep simulated LTS `JENKINS_VERSION` and `WAR_SHA` up to date * also update `LTS_JENKINS_VERSION` in tests * update LTS golden file (follow-up of #2184) * add missing `scmid` property to `target`s Cf #2198 * restrict matchpattern like in #2200 * add `skip-changelog` label as this bump is equivalent to a noop with regard to the content of the image
1 parent 089a2eb commit 14f933d

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
name: Bump simulated LTS `JENKINS_VERSION` version
3+
4+
scms:
5+
default:
6+
kind: github
7+
spec:
8+
user: "{{ .github.user }}"
9+
email: "{{ .github.email }}"
10+
owner: "{{ .github.owner }}"
11+
repository: "{{ .github.repository }}"
12+
token: "{{ requiredEnv .github.token }}"
13+
username: "{{ .github.username }}"
14+
branch: "{{ .github.branch }}"
15+
16+
sources:
17+
latestVersion:
18+
kind: githubrelease
19+
name: Get latest Jenkins Core LTS release version (.1 only)
20+
spec:
21+
owner: jenkinsci
22+
repository: jenkins
23+
token: "{{ requiredEnv .github.token }}"
24+
username: "{{ .github.username }}"
25+
versionfilter:
26+
kind: regex
27+
pattern: >-
28+
\d+\.\d+\.1$
29+
transformers:
30+
- trimprefix: "jenkins-"
31+
latestWarSha:
32+
kind: shell
33+
name: Get latest Jenkins Core LTS sha256 checksum
34+
spec:
35+
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"
36+
37+
conditions:
38+
isDockerImagePublished:
39+
name: Check if the docker image has been published
40+
kind: dockerimage
41+
sourceid: latestVersion
42+
spec:
43+
image: jenkins/jenkins
44+
45+
targets:
46+
updateJenkinsVersionInJenkinsfile:
47+
name: Update default value of simulated LTS JENKINS_VERSION in Jenkinsfile
48+
kind: file
49+
scmid: default
50+
sourceid: latestVersion
51+
spec:
52+
file: Jenkinsfile
53+
matchpattern: >-
54+
'JENKINS_VERSION=(.*)'
55+
content: >-
56+
'JENKINS_VERSION={{ source "latestVersion" }}'
57+
updateJenkinsVersionInTests:
58+
name: Update default value of LTS_JENKINS_VERSION in tests
59+
kind: file
60+
scmid: default
61+
sourceid: latestVersion
62+
spec:
63+
file: tests/bake.bats
64+
matchpattern: >-
65+
LTS_JENKINS_VERSION=(.*)
66+
content: >-
67+
LTS_JENKINS_VERSION="{{ source "latestVersion" }}"
68+
updateJenkinsVersionInGoldenFiles:
69+
kind: file
70+
scmid: default
71+
sourceid: latestVersion
72+
name: Update value of JENKINS_VERSION in LTS golden file
73+
spec:
74+
file: tests/golden/expected_tags_latest_lts.txt
75+
matchpattern: :(\d+\.\d+\.\d+)
76+
replacepattern: :{{ source "latestVersion" }}-
77+
updateWarSha:
78+
name: Update default value of simulated LTS WAR_SHA in Jenkinsfile
79+
kind: file
80+
scmid: default
81+
sourceid: latestWarSha
82+
spec:
83+
file: Jenkinsfile
84+
matchpattern: >-
85+
'WAR_SHA=(.*)'
86+
content: >-
87+
'WAR_SHA={{ source "latestWarSha" }}'
88+
89+
actions:
90+
default:
91+
kind: github/pullrequest
92+
title: Bump simulated LTS `JENKINS_VERSION` to {{ source "latestVersion" }}
93+
scmid: default
94+
spec:
95+
labels:
96+
- dependencies
97+
- jenkins-version
98+
- skip-changelog

0 commit comments

Comments
 (0)