Skip to content

Commit 4d817e0

Browse files
authored
Update default value of Jenkins version (#1411)
* Update default value of Jenkins version * Try and fix tests * Fix ps1 * Minimize diff * Remove HTML from regex * facepalm
1 parent e400fd8 commit 4d817e0

File tree

12 files changed

+33
-28
lines changed

12 files changed

+33
-28
lines changed

11/almalinux/almalinux8/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ RUN curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION
6666

6767
# jenkins version being bundled in this docker image
6868
ARG JENKINS_VERSION
69-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
69+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7070

7171
# jenkins.war checksum, download will be validated using it
72-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
72+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7373

7474
# Can be used to customize where jenkins.war get downloaded from
7575
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

11/alpine/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ RUN mkdir -p ${REF}/init.groovy.d
6666

6767
# jenkins version being bundled in this docker image
6868
ARG JENKINS_VERSION
69-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
69+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7070

7171
# jenkins.war checksum, download will be validated using it
72-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
72+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7373

7474
# Can be used to customize where jenkins.war get downloaded from
7575
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

11/centos/centos7/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ RUN curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION
7575

7676
# jenkins version being bundled in this docker image
7777
ARG JENKINS_VERSION
78-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.289.3}
78+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7979

8080
# jenkins.war checksum, download will be validated using it
81-
ARG JENKINS_SHA=996dfd29d5f933546af9e9f77c29b371fb0627b8266b6c9f134ac2e0f1248b87
81+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
8282

8383
# Can be used to customize where jenkins.war get downloaded from
8484
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

11/debian/bullseye-slim/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ RUN mkdir -p ${REF}/init.groovy.d
6969

7070
# jenkins version being bundled in this docker image
7171
ARG JENKINS_VERSION
72-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
72+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7373

7474
# jenkins.war checksum, download will be validated using it
75-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
75+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7676

7777
# Can be used to customize where jenkins.war get downloaded from
7878
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

11/debian/bullseye/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ RUN mkdir -p ${REF}/init.groovy.d
6767

6868
# jenkins version being bundled in this docker image
6969
ARG JENKINS_VERSION
70-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
70+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7171

7272
# jenkins.war checksum, download will be validated using it
73-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
73+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7474

7575
# Can be used to customize where jenkins.war get downloaded from
7676
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

11/rhel/ubi8/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ RUN curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION
6868

6969
# jenkins version being bundled in this docker image
7070
ARG JENKINS_VERSION
71-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
71+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7272

7373
# jenkins.war checksum, download will be validated using it
74-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
74+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7575

7676
# Can be used to customize where jenkins.war get downloaded from
7777
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

11/windows/windowsservercore-2019/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ RUN New-Item -ItemType Directory -Force -Path C:/ProgramData/Jenkins/Reference/i
4040

4141
# jenkins version being bundled in this docker image
4242
ARG JENKINS_VERSION
43-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
43+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
4444

4545
# jenkins.war checksum, download will be validated using it
46-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
46+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
4747

4848
# Can be used to customize where jenkins.war get downloaded from
4949
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

17/alpine/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ RUN mkdir -p ${REF}/init.groovy.d
6767

6868
# jenkins version being bundled in this docker image
6969
ARG JENKINS_VERSION
70-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
70+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7171

7272
# jenkins.war checksum, download will be validated using it
73-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
73+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7474

7575
# Can be used to customize where jenkins.war get downloaded from
7676
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

17/debian/bullseye-slim/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ RUN mkdir -p ${REF}/init.groovy.d
6969

7070
# jenkins version being bundled in this docker image
7171
ARG JENKINS_VERSION
72-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
72+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7373

7474
# jenkins.war checksum, download will be validated using it
75-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
75+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7676

7777
# Can be used to customize where jenkins.war get downloaded from
7878
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

17/debian/bullseye/hotspot/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ RUN mkdir -p ${REF}/init.groovy.d
6767

6868
# jenkins version being bundled in this docker image
6969
ARG JENKINS_VERSION
70-
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.303}
70+
ENV JENKINS_VERSION ${JENKINS_VERSION:-2.356}
7171

7272
# jenkins.war checksum, download will be validated using it
73-
ARG JENKINS_SHA=4dfe49cd7422ec4317a7c7a7c083f40fa475a58a7747bd94187b2cf222006ac0
73+
ARG JENKINS_SHA=1163c4554dc93439c5eef02b06a8d74f98ca920bbc012c2b8a089d414cfa8075
7474

7575
# Can be used to customize where jenkins.war get downloaded from
7676
ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war

tests/runtime.Tests.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Describe "[$TEST_TAG] passing JVM parameters" {
7171
$cspSetting = @'
7272
-Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';\"
7373
'@
74-
$cspRegex = [regex]::Escape("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';")
74+
$cspRegex = [regex]::Escape("default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';")
7575

7676
function Start-With-Opts() {
7777
Param (
@@ -100,11 +100,11 @@ Describe "[$TEST_TAG] passing JVM parameters" {
100100
}
101101

102102
function Get-Csp-Value() {
103-
return (Get-JenkinsWebpage $SUT_CONTAINER "/systemInfo").Replace("</tr>","</tr>`n").Replace("<wbr>", "").Split("`n") | Select-String -Pattern '<td class="pane">hudson.model.DirectoryBrowserSupport.CSP</td>'
103+
return (Run-In-Script-Console $SUT_CONTAINER "System.getProperty('hudson.model.DirectoryBrowserSupport.CSP')")
104104
}
105105

106106
function Get-Timezone-Value() {
107-
return (Get-JenkinsWebpage $SUT_CONTAINER "/systemInfo").Replace("</tr>","</tr>`n").Replace("<wbr>", "").Split("`n") | Select-String -Pattern '<td class="pane">user.timezone</td>'
107+
return (Run-In-Script-Console $SUT_CONTAINER "System.getProperty('user.timezone')")
108108
}
109109
}
110110

tests/test_helpers.psm1

+10-5
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function Get-JenkinsPassword($Container) {
137137
return $null
138138
}
139139

140-
function Get-JenkinsWebpage($Container, $Url) {
140+
function Run-In-Script-Console($Container, $Script) {
141141
$jenkinsPassword = Get-JenkinsPassword $Container
142142
$jenkinsUrl = Get-JenkinsUrl $Container
143143
if($null -ne $jenkinsPassword) {
@@ -146,10 +146,15 @@ function Get-JenkinsWebpage($Container, $Url) {
146146
$basicAuthValue = "Basic $encodedCreds"
147147
$Headers = @{ Authorization = $basicAuthValue }
148148

149-
$res = Invoke-WebRequest -Uri $('{0}{1}' -f $jenkinsUrl, $Url) -Headers $Headers -TimeoutSec 60 -Method Get -UseBasicParsing
150-
if($res.StatusCode -eq 200) {
151-
return $res.Content
152-
}
149+
$crumb = (Invoke-RestMethod -Uri $('{0}{1}' -f $jenkinsUrl, '/crumbIssuer/api/json') -Headers $Headers -TimeoutSec 60 -Method Get -SessionVariable session -UseBasicParsing).crumb
150+
if ($null -ne $crumb) {
151+
$Headers += @{ "Jenkins-Crumb" = $crumb }
152+
}
153+
$body = @{ script = $Script }
154+
$res = Invoke-WebRequest -Uri $('{0}{1}' -f $jenkinsUrl, '/scriptText') -Headers $Headers -TimeoutSec 60 -Method Post -WebSession $session -UseBasicParsing -Body $body
155+
if ($res.StatusCode -eq 200) {
156+
return $res.Content.replace('Result: ', '')
157+
}
153158
}
154159
return $null
155160
}

0 commit comments

Comments
 (0)