Skip to content

Commit c5106c1

Browse files
authored
Merge pull request #830 from jenkins-infra/feat/war-pgp-signatures
feat(package) publish the WAR signature file
2 parents 1e16cfa + aada25f commit c5106c1

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

utils/release.bash

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,22 @@ function downloadAzureKeyvaultSecret() {
118118
--file "${SIGN_CERTIFICATE}"
119119
}
120120

121-
# JENKINS_VERSION: Define which version will be packaged where:
122-
# * \'latest\' means the latest version available
123-
# * <version> represents any valid existing version like 2.440.3 available at JENKINS_DOWNLOAD_URL
124-
# JENKINS_DOWNLOAD_URL: Specify the endpoint to use for downloading jenkins.war
125-
# MAVEN_REPOSITORY_USERNAME: optional username for repository access
126-
# MAVEN_REPOSITORY_PASSWORD: optional password for repository access
121+
# Once the exact Jenkins Version to get is determined, we retrieve the WAR and the signature file from Artifactory
122+
# The signature is verified to ensure the GPG key is correct
127123
function downloadJenkinsWar() {
128-
jv download
124+
jenkinsVersion="$(jv get)" # jv utilizes the JENKINS_VERSION environment variable which can be the line (latest/weekly/lts/stable) or an exact version
125+
126+
# Download WAR from Artifactory. Note: the expected filename is "jenkins.war".
127+
warUrl="https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/${jenkinsVersion}/jenkins-war-${jenkinsVersion}.war"
128+
curl --fail --silent --show-error --location --output "${WAR}" \
129+
"${warUrl}"
130+
131+
# Download signature from Artifactory (signed by Maven during the release process). Note: the expected filename is "jenkins.war.asc".
132+
warSignatureUrl="${warUrl}.asc"
133+
curl --fail --silent --show-error --location --output "${WAR}.asc" \
134+
"${warSignatureUrl}"
135+
136+
# TODO: verify the download. Requires retrieving the correct GPG key (edge case when rotating key, might need to use state files)
129137
}
130138

131139
function getGPGKeyFromAzure() {

0 commit comments

Comments
 (0)