From de8f9f1afd3111dd70d68ba85341b0cdd6043bc3 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 26 Sep 2017 12:39:27 -0400 Subject: [PATCH] Handle yangtools nitrogen on non-standard branch YangTools uses v1.2.x as it's nitrogen contribution so we need to handle the difference in branch naming. Change-Id: I9336c231bdb853d697c77a2d5d649d0036f6dc4d Signed-off-by: Thanh Ha --- jjb/autorelease/version-bump.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/jjb/autorelease/version-bump.sh b/jjb/autorelease/version-bump.sh index cb1bd87b3..a44337e0e 100644 --- a/jjb/autorelease/version-bump.sh +++ b/jjb/autorelease/version-bump.sh @@ -25,7 +25,18 @@ BRANCH="$GERRIT_BRANCH" set -eu -o pipefail git checkout -b "${BRANCH,,}" "origin/${BRANCH,,}" -git submodule foreach git checkout -b "${BRANCH,,}" "origin/${BRANCH,,}" + +# TODO: Simplify once stable/nitrogen is no longer supported. +for module in $(git submodule | awk '{ print $2 }') +do + pushd "$module" + if [ "$GERRIT_BRANCH" == "stable/nitrogen" ] && [ "$module" == "yangtools" ]; then + git checkout -b "v1.2.x" "origin/v1.2.x" + else + git checkout -b "${BRANCH,,}" "origin/${BRANCH,,}" + fi + popd +done # Setup Gerrit remove to ensure Change-Id gets set on commit. git config --global --add gitreview.username "jenkins-releng" @@ -51,10 +62,11 @@ do # 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" + git bundle create "$patch_dir/${module//\//-}.bundle" "origin/v1.2.x..HEAD" else git format-patch --stdout "origin/${BRANCH,,}" > "$patch_dir/${module//\//-}.patch" + git bundle create "$patch_dir/${module//\//-}.bundle" "origin/${BRANCH,,}..HEAD" fi - git bundle create "$patch_dir/${module//\//-}.bundle" "origin/${BRANCH,,}..HEAD" popd done -- 2.36.6