Add a --dry-run flag to build that allows a Jenkins build without deploying anything.
Change-Id: I240da05118e86a85134bf2eb04ea6a617502e47c
diff --git a/tools/build/onos-build-and-upload b/tools/build/onos-build-and-upload
index bdf2f36..ba4441c 100755
--- a/tools/build/onos-build-and-upload
+++ b/tools/build/onos-build-and-upload
@@ -6,27 +6,35 @@
VERSION=$1
NEXT_VERSION=$2
BRANCH=$3
+DRY_RUN=$4
+
+dryRun=0
+if [ "${DRY_RUN}" == "--dry-run" ]; then
+ dryRun=1
+fi
set -e
set -x
# fix version strings, build artifacts, upload artifacts
-onos-release $VERSION | tee build.log
+onos-release $VERSION $DRY_RUN | tee build.log
-# upload docs
-onos-upload-docs ${WIKI_USER}
+if [ $dryRun -eq 0 ]; then
+ # upload docs
+ onos-upload-docs ${WIKI_USER}
-# upload release bits
-onos-upload-bits
+ # upload release bits
+ onos-upload-bits
-# spot check that uploaded artifacts are correct
-check-uploaded-maven-artifacts $VERSION $ONOS_ROOT https://oss.sonatype.org/content/groups/staging
+ # spot check that uploaded artifacts are correct
+ check-uploaded-maven-artifacts $VERSION $ONOS_ROOT https://oss.sonatype.org/content/groups/staging
-# set the version strings to the next version
-onos-snapshot ${NEXT_VERSION}
+ # set the version strings to the next version
+ onos-snapshot ${NEXT_VERSION}
-# Push version string changes to git
-git push origin ${BRANCH}
+ # Push version string changes to git
+ git push origin ${BRANCH}
-# Push tag for this build to git
-git push origin ${VERSION}
+ # Push tag for this build to git
+ git push origin ${VERSION}
+fi