X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=jjb%2Fautorelease%2Fprepare-release.sh;h=59c0a94eeacf5b5492d44aa9994e84749d0f37c7;hb=5ce4f06525658e4621c69593e1b40f80dabc893b;hp=3af30a88ecb1aae13c208d320d64733b5a8ea161;hpb=9f12a4c716743d8440e3c0be37180c6b072033ca;p=releng%2Fbuilder.git diff --git a/jjb/autorelease/prepare-release.sh b/jjb/autorelease/prepare-release.sh index 3af30a88e..59c0a94ee 100644 --- a/jjb/autorelease/prepare-release.sh +++ b/jjb/autorelease/prepare-release.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# @License EPL-1.0 +#!/bin/bash -l +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2015, 2017 The Linux Foundation and others. # @@ -16,7 +16,8 @@ # 4) Create tarball for distribution. # RELEASE_TAG=Beryllium-SR1 # Example -# RELEASE_BRANCH=stable/beryllium # Example + +echo "---> prepare-release.sh" # Set release tag as $STREAM, when no release tag is passed RELEASE_TAG="${RELEASE_TAG:-${STREAM^}}" @@ -24,33 +25,34 @@ RELEASE_TAG="${RELEASE_TAG:-${STREAM^}}" RELEASE_TAG="${RELEASE_TAG^}" # Directory to put git format-patches -PATCH_DIR="$WORKSPACE/patches" +PATCH_DIR="$WORKSPACE/archives/patches" +mkdir -p "$PATCH_DIR" + +# Get the current submodule commit hashes. +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} \ + | tee -a $PATCH_DIR/taglist.log" echo "$RELEASE_TAG" -# Remove this case statement when Carbon is no longer supported. -# 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*) - lftools version release "$RELEASE_TAG" - ;; - *) - find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//' - ;; -esac +find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//' + +# Ignore changes to Final distribution since that will be released separately +pushd integration/distribution || exit 1 + git checkout -f opendaylight/pom.xml +popd || exit 1 git submodule foreach "git commit -am \"Release $RELEASE_TAG\" || true" git commit -am "Release $RELEASE_TAG" -mkdir patches -# TODO: Fix this workaround so that scripts will ensure that taglist.log exists and archived. -mv taglist.log "$PATCH_DIR" || true 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/$RELEASE_BRANCH" > "$PATCH_DIR/${module//\//-}.patch" + pushd "$module" || exit + git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${module//\//-}.patch" git bundle create "$PATCH_DIR/${module//\//-}.bundle" "origin/master..HEAD" - popd + popd || exit done -tar cvzf patches.tar.gz -C "$WORKSPACE" patches +tar cvzf "$WORKSPACE/archives/patches.tar.gz" -C "$WORKSPACE/archives" patches rm "$PATCH_DIR"/*.bundle