Merge "Update Ubuntu 16.04 mininet-ovs-25 image"
[releng/builder.git] / jjb / autorelease / prepare-release.sh
index 2d0f067deb9b979f85194dc321700cf486df9e9a..51248b15e3f104bf30c48644ad272e3ecd0d5d8c 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
+# SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2015, 2017 The Linux Foundation and others.
 #
@@ -33,7 +33,7 @@ echo autorelease "$(git rev-parse --verify HEAD)" "${RELEASE_TAG}" \
     | tee -a "$PATCH_DIR/taglist.log"
 # Disable SC2154 because we want $path to be the submodule parameter not the shell.
 # shellcheck disable=SC2154
-git submodule foreach "echo \$path $(git rev-parse --verify HEAD) ${RELEASE_TAG} \
+git submodule foreach "echo \$path \$(git rev-parse --verify HEAD) ${RELEASE_TAG} \
     | tee -a $PATCH_DIR/taglist.log"
 
 echo "$RELEASE_TAG"
@@ -41,7 +41,7 @@ echo "$RELEASE_TAG"
 # Nitrogen onwards we do not want to use the release tag so simply need to
 # strip xml files of -SNAPSHOT tags.
 case "$RELEASE_TAG" in
-    Boron*|Carbon*)
+    Carbon*)
         lftools version release "$RELEASE_TAG"
         ;;
     *)
@@ -54,7 +54,12 @@ git commit -am "Release $RELEASE_TAG"
 modules=$(xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' pom.xml)
 for module in $modules; do
     pushd "$module"
-    git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${module//\//-}.patch"
+    # TODO: Remove once stable/nitrogen is no longer supported.
+    if [ "$GERRIT_BRANCH" == "stable/nitrogen" ] && [ "$module" == "yangtools" ]; then
+        git format-patch --stdout "origin/v1.2.x" > "$PATCH_DIR/${module//\//-}.patch"
+    else
+        git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${module//\//-}.patch"
+    fi
     git bundle create "$PATCH_DIR/${module//\//-}.bundle" "origin/master..HEAD"
     popd
 done