-
-
Couldn't load subscription status.
- Fork 4.7k
chore: download war from mirrors unless we are publishing a release #2074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: download war from mirrors unless we are publishing a release #2074
Conversation
40dc564 to
06078fb
Compare
|
I forgot Jenkins is setting its own
In draft while I rework that point and check the Windows build. |
…n builtin environment variable
Good catch! That's a tricky one 😅 |
Just pick a different var ^.^. I was surprised JENKINS_URL was used as that is a standard Jenkin env var. |
aa634ff 😉
Same ^^ |
Similar to the other ARG declarations, and allowing `` to be evaluated on Windows builds
…aming" This reverts commit 2dc353c.
This reverts commit c9f1876.
| $warShaURL = '{0}.sha256' -f $env:WAR_URL | ||
| $webClient = New-Object System.Net.WebClient | ||
| $env:WAR_SHA = $webClient.DownloadString($jenkinsShaURL).ToUpper() | ||
| $env:WAR_SHA = $webClient.DownloadString($warShaURL).Split(' ')[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the help of temporary debug statements in fd32886, I found out why my builds were failing on Windows on the SHA256 checksum:
- Checksum in the Windows Dockerfile:
docker/windows/windowsservercore/hotspot/Dockerfile
Lines 107 to 108 in 80da2e1
RUN Invoke-WebRequest -Uri "$env:WAR_URL" -OutFile C:/ProgramData/Jenkins/jenkins.war ; ` if ((Get-FileHash C:/ProgramData/Jenkins/jenkins.war -Algorithm SHA256).Hash -ne $env:WAR_SHA) {exit 1} (Get-FileHash C:/ProgramData/Jenkins/jenkins.war -Algorithm SHA256).Hashreturns only the hash (efc91d6be8d79dd078e7f930fc4a5f135602d0822a5efe9091808fdd74607d32)- The content of https://get.jenkins.io/war/2.504/jenkins.war.sha256 is
efc91d6be8d79dd078e7f930fc4a5f135602d0822a5efe9091808fdd74607d32 jenkins.war - Reported initially in uppercase:
- https://ci.jenkins.io/job/Packaging/job/docker/job/PR-2074/10/pipeline-overview/?start-byte=0&selected-node=172#log-172-1
- https://ci.jenkins.io/job/Packaging/job/docker/job/PR-2074/10/pipeline-overview/?start-byte=0&selected-node=172#log-172-15
EFC91D6BE8D79DD078E7F930FC4A5F135602D0822A5EFE9091808FDD74607D32 JENKINS.WAR
- Result after the fix:
- https://ci.jenkins.io/job/Packaging/job/docker/job/PR-2074/11/pipeline-overview/?start-byte=0&selected-node=183#log-183-1
- https://ci.jenkins.io/job/Packaging/job/docker/job/PR-2074/11/pipeline-overview/?start-byte=0&selected-node=183#log-183-15
efc91d6be8d79dd078e7f930fc4a5f135602d0822a5efe9091808fdd74607d32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change passed my tests and it passes CI tests. Code review looks good as well. Thanks!
Let's use it for the weekly build of 2.529.
|
Confirmed working as intended with the 2.529 weekly release by checking logs on trusted.ci.jenkins.io in pair with @dduportal |
This PR helps reducing Artifactory bandwidth use for container builds by downloading the Jenkins war file from the nearest mirror site rather than downloading from repo.jenkins-ci.org when building without publishing.
Refs:
Testing done
Build Dockerfile directly without `make`, using get.jenkins.io
This build uses default JENKINS_VERSION & JENKINS_SHA from Dockerfile.
Output snippet showing download from get.jenkins.io:
Build all images, no additional argument, using get.jenkins.io
This build uses default JENKINS_VERSION & JENKINS_SHA from Dockerfile.
Output snippet showing download from get.jenkins.io:
Build all images specifying a Weekly `JENKINS_VERSION`, using get.jenkins.io with `war`
Output snippet showing download from get.jenkins.io:
Build all images specifying a LTS `JENKINS_VERSION`, using get.jenkins.io with `war-stable`
Output snippet showing download from get.jenkins.io:
Build all images, no additional argument, using repo.jenkins-ci.org
Output snippet showing download from get.jenkins.io:
Build all images specifying a Weekly`JENKINS_VERSION`, using repo.jenkins-ci.org
Output snippet showing download from get.jenkins.io:
Build all images specifying a LTS`JENKINS_VERSION`, repo.jenkins-ci.org
Output snippet showing download from get.jenkins.io:
Build Windows image specifying a LTS `JENKINS_VERSION`, using get.jenkins.io with `war-stable`
https://ci.jenkins.io/job/Packaging/job/docker/job/PR-2074/14/execution/node/388/log/?consoleFull
Output snippet from https://ci.jenkins.io/job/Packaging/job/docker/job/PR-2074/14/execution/node/388/log/?consoleFull:
Submitter checklist