Merge "Improve DRY_RUN mode to perform a build"
authorAnil Belur <abelur@linuxfoundation.org>
Wed, 28 Feb 2018 01:33:14 +0000 (01:33 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 28 Feb 2018 01:33:14 +0000 (01:33 +0000)
jjb/autorelease/autorelease-templates.yaml
jjb/autorelease/version-bump.sh

index 495787e1f5c5f0085333b00a0d3f2136f1d2a6d9..58a2336fa964b2c586bb38b684afdc972a294f10 100644 (file)
           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
 
index a44337e0e42713ae66411f7f559a4a5f49f0d27e..f88423f0a86314fc65ff12a75d24ce1e374cb0fb 100644 (file)
@@ -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