@@ -447,8 +447,9 @@ function showReleasePlan() {
447447}
448448
449449function 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
524525function 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
573576function 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+
600614function 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-
700708export JENKINS_VERSION
701709export JENKINS_DOWNLOAD_URL
702710export MAVEN_REPOSITORY_USERNAME
703711export MAVEN_REPOSITORY_PASSWORD
704712export WAR
705713export BRAND
706- export RELEASELINE
707714export ORGANIZATION
708715export BUILDENV
709716export CREDENTIAL
@@ -713,10 +720,6 @@ export GPG_KEYNAME
713720export RELEASE_PROFILE
714721export RELEASELINE
715722
716- export BASE_BIN_DIR
717- export GET_JENKINS_IO_PRODUCTION
718- export PKG_JENKINS_IO_PRODUCTION
719-
720723if [[ ! -d $WORKING_DIRECTORY ]]; then
721724 mkdir -p " ${WORKING_DIRECTORY} "
722725fi
0 commit comments