From: Anil Belur Date: Wed, 28 Feb 2018 01:33:14 +0000 (+0000) Subject: Merge "Improve DRY_RUN mode to perform a build" X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=2cebce4cb7d453c1509dedb3f9cc54e971506693;hp=b145d129d43f578a34fe37dae2469d07db0076d1;p=releng%2Fbuilder.git Merge "Improve DRY_RUN mode to perform a build" --- diff --git a/jjb/autorelease/autorelease-templates.yaml b/jjb/autorelease/autorelease-templates.yaml index 495787e1f..58a2336fa 100644 --- a/jjb/autorelease/autorelease-templates.yaml +++ b/jjb/autorelease/autorelease-templates.yaml @@ -286,7 +286,9 @@ name: DRY_RUN default: true description: | - If DRY_RUN is enabled modifications are not published to Gerrit. + If DRY_RUN is enabled modifications are not published to Gerrit + and artifacts are not pushed to Nexus. Instead the build will be + performed using the goals "clean install". - maven-exec: maven-version: mvn33 diff --git a/jjb/autorelease/version-bump.sh b/jjb/autorelease/version-bump.sh index a44337e0e..f88423f0a 100644 --- a/jjb/autorelease/version-bump.sh +++ b/jjb/autorelease/version-bump.sh @@ -70,7 +70,10 @@ do popd done -# Verify +########## +# Verify # +########## + { echo "----> Verify version bump" git submodule foreach git show HEAD @@ -80,27 +83,40 @@ done ls "$patch_dir" } | tee -a "$LOG_FILE" -# Push +######### +# Build # +######### + +MVN_GOALS=(clean install) if [ "$DRY_RUN" = "false" ] then - # Run a build here! Should be safe to run mvn clean deploy as nothing should be + # Should be safe to run mvn clean deploy as nothing should be # using the version bumped versions just yet. - ./scripts/fix-relativepaths.sh - "$MVN" clean deploy -Pq \ - -s "$SETTINGS_FILE" \ - -gs "$GLOBAL_SETTINGS_FILE" \ - -DaltDeploymentRepository="opendaylight-snapshot::default::https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot" \ - --show-version \ - --batch-mode \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Djenkins \ - -Dmaven.repo.local=/tmp/r \ - -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r - - # Clear any changes caused by Maven build - git checkout -f - git submodule foreach git checkout -f + MVN_GOALS=(clean deploy) +fi + +./scripts/fix-relativepaths.sh +"$MVN" "${MVN_GOALS[@]}" -Pq \ +-s "$SETTINGS_FILE" \ +-gs "$GLOBAL_SETTINGS_FILE" \ +-DaltDeploymentRepository="opendaylight-snapshot::default::https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot" \ +--show-version \ +--batch-mode \ +-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ +-Djenkins \ +-Dmaven.repo.local=/tmp/r \ +-Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r + +# Clear any changes caused by Maven build +git checkout -f +git submodule foreach git checkout -f + +######## +# Push # +######## +if [ "$DRY_RUN" = "false" ] +then # Push up patches last, as long as nothing failed. git submodule foreach git review --yes -t "${RELEASE_TAG}" fi