Skip to content

Commit dd4367b

Browse files
committed
fix(release,utils) only check for packaging environment variables from packaging functions to avoid unrelated failures during release build
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
1 parent e19a62d commit dd4367b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

utils/release.bash

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,9 @@ function showReleasePlan() {
447447
}
448448

449449
function showPackagingPlan() {
450-
set +x
450+
checkPackagingEnvironment
451451

452+
set +x # To avoid polluting output
452453
local staging_description production_description release_packages_description
453454
release_packages_description="Jenkins core packages for version $(jv get) ('${RELEASELINE:-weekly}' release)"
454455
staging_description="staging (at https://$(basename "${BASE_BIN_DIR}").staging.pkg.origin.jenkins.io and https://staging.get.jenkins.io/$(basename "${BASE_PKG_DIR}"))"
@@ -518,10 +519,12 @@ function showPackagingPlan() {
518519
echo "Maven repository promotion is disabled"
519520
fi
520521

521-
set -x
522+
set -x # Back to normal
522523
}
523524

524525
function promotePackages() {
526+
checkPackagingEnvironment
527+
525528
## Step 1/3 - Copy binaries and HTML from staging to (remote) archives.jenkins.io (mirror fallback)
526529
pushd "${BASE_BIN_DIR}"
527530
rsync --recursive \
@@ -571,6 +574,8 @@ function promotePackages() {
571574
}
572575

573576
function prepareStaging() {
577+
checkPackagingEnvironment
578+
574579
set +u
575580
local rpmreleaseline="rpm${RELEASELINE}"
576581
local debianreleaseline="rpm${RELEASELINE}"
@@ -597,6 +602,15 @@ function prepareStaging() {
597602
fi
598603
}
599604

605+
function checkPackagingEnvironment() {
606+
# Packaging publication environment (path to production file system provided by the agent)
607+
: "${BASE_BIN_DIR}"
608+
: "${GET_JENKINS_IO_PRODUCTION}"
609+
: "${PKG_JENKINS_IO_PRODUCTION}"
610+
611+
export BASE_BIN_DIR GET_JENKINS_IO_PRODUCTION PKG_JENKINS_IO_PRODUCTION
612+
}
613+
600614
function main() {
601615
if [[ $# -eq 0 ]]; then
602616
configureGPG
@@ -691,19 +705,12 @@ source "${ROOT_DIR}/profile.d/${RELEASE_PROFILE}"
691705
: "${RELEASE_GIT_PRODUCTION_REPOSITORY:=$RELEASE_GIT_REPOSITORY }"
692706
: "${RELEASE_GIT_PRODUCTION_BRANCH:=$RELEASE_GIT_BRANCH}"
693707

694-
# Publication environment (path to production file system provided by the agent)
695-
: "${BASE_BIN_DIR}"
696-
: "${GET_JENKINS_IO_PRODUCTION}"
697-
: "${PKG_JENKINS_IO_PRODUCTION}"
698-
699-
700708
export JENKINS_VERSION
701709
export JENKINS_DOWNLOAD_URL
702710
export MAVEN_REPOSITORY_USERNAME
703711
export MAVEN_REPOSITORY_PASSWORD
704712
export WAR
705713
export BRAND
706-
export RELEASELINE
707714
export ORGANIZATION
708715
export BUILDENV
709716
export CREDENTIAL
@@ -713,10 +720,6 @@ export GPG_KEYNAME
713720
export RELEASE_PROFILE
714721
export RELEASELINE
715722

716-
export BASE_BIN_DIR
717-
export GET_JENKINS_IO_PRODUCTION
718-
export PKG_JENKINS_IO_PRODUCTION
719-
720723
if [[ ! -d $WORKING_DIRECTORY ]]; then
721724
mkdir -p "${WORKING_DIRECTORY}"
722725
fi

0 commit comments

Comments
 (0)