Skip to content

Commit 1e2834d

Browse files
authored
Merge pull request #713 from jenkinsci/fix/staging
fix(war,msi) generate correct `latest` symlinks to directories
2 parents 3ee2adf + d8a7276 commit 1e2834d

File tree

2 files changed

+14
-27
lines changed

2 files changed

+14
-27
lines changed

msi/publish/publish.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,16 @@ function uploadPackage() {
3030
sha256sum "${MSI}" >"${MSI_SHASUM}"
3131
cat "${MSI_SHASUM}"
3232

33-
# Update the symlink to point to most recent Windows build
34-
#
35-
# Remove anything in current directory named 'latest'
36-
# This is a safety measure just in case something was left there previously
37-
rm -rf latest
38-
39-
# Create a local symlink pointing to the MSI file in the VERSION directory.
40-
# Don't need VERSION directory or MSI locally, just the unresolved symlink.
41-
# The jenkins.io page downloads http://mirrors.jenkins-ci.org/windows/latest
42-
# and assumes it points to the most recent MSI file.
43-
ln -s "${VERSION}/$(basename "$MSI")" latest
44-
45-
# Local
4633
rsync --archive \
4734
--verbose \
4835
--progress \
49-
"${MSI}" "${MSI_SHASUM}" latest "${MSIDIR}/${VERSION}/"
36+
"${MSI}" "${MSI_SHASUM}" "${MSIDIR}/${VERSION}/"
37+
38+
# Update the symlink to point to most recent MSI directory
39+
pushd "${MSIDIR}"
40+
rm -rf latest # This is a safety measure just in case something was left there previously
41+
ln -s "${VERSION}" latest
42+
popd
5043
}
5144

5245
# The site need to be located in the binary directory

war/publish/publish.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,16 @@ function uploadPackage() {
2828
sha256sum "${WAR}" | sed "s, .*, ${ARTIFACTNAME}.war," >"${WAR_SHASUM}"
2929
cat "${WAR_SHASUM}"
3030

31-
# Update the symlink to point to most recent Windows build
32-
#
33-
# Remove anything in current directory named 'latest'
34-
# This is a safety measure just in case something was left there previously
35-
rm -rf latest
36-
37-
# Create a local symlink pointing to the MSI file in the VERSION directory.
38-
# Don't need VERSION directory or MSI locally, just the unresolved symlink.
39-
# The jenkins.io page downloads http://mirrors.jenkins-ci.org/windows/latest
40-
# and assumes it points to the most recent MSI file.
41-
ln -s "${VERSION}/$(basename "$WAR")" latest
42-
4331
rsync --archive \
4432
--verbose \
4533
--progress \
46-
"${WAR}" "${WAR_SHASUM}" latest "${WARDIR}/${VERSION}/"
34+
"${WAR}" "${WAR_SHASUM}" "${WARDIR}/${VERSION}/"
35+
36+
# Update the symlink to point to most recent WAR directory
37+
pushd "${WARDIR}"
38+
rm -rf latest # This is a safety measure just in case something was left there previously
39+
ln -s "${VERSION}" latest
40+
popd
4741
}
4842

4943
# Site html need to be located in the binary directory

0 commit comments

Comments
 (0)