X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fautorelease%2Finclude-raw-autorelease-release-versions.sh;h=0b38f0ee081549f07041083a0cdd8644b1b80c1d;hb=cca8d301b756c4defca2de659f6731d71621b1f9;hp=66d8808b183079958dc72666b202720302cdd65b;hpb=87b4fdc2b3493f2ee2a9af2478f62bac86032831;p=releng%2Fbuilder.git diff --git a/jjb/autorelease/include-raw-autorelease-release-versions.sh b/jjb/autorelease/include-raw-autorelease-release-versions.sh index 66d8808b1..0b38f0ee0 100644 --- a/jjb/autorelease/include-raw-autorelease-release-versions.sh +++ b/jjb/autorelease/include-raw-autorelease-release-versions.sh @@ -1,7 +1,7 @@ #!/bin/bash # @License EPL-1.0 ############################################################################## -# Copyright (c) 2015 The Linux Foundation and others. +# Copyright (c) 2015, 2017 The Linux Foundation and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 @@ -12,28 +12,36 @@ # RELEASE_TAG=Beryllium-SR1 # Example # RELEASE_BRANCH=stable/beryllium # Example +LFTOOLS_DIR="$WORKSPACE/.venv-lftools" +if [ ! -d "$LFTOOLS_DIR" ] +then + virtualenv "$LFTOOLS_DIR" + # shellcheck disable=SC1090 + source "$LFTOOLS_DIR/bin/activate" + pip install --upgrade pip + pip freeze + pip install lftools +fi +# shellcheck disable=SC1090 +source "$LFTOOLS_DIR/bin/activate" + # Directory to put git format-patches -PATCH_DIR=`pwd`/patches +PATCH_DIR="$WORKSPACE/patches" -echo $RELEASE_TAG -./scripts/version.sh release $RELEASE_TAG +echo "$RELEASE_TAG" +lftools version release "$RELEASE_TAG" git submodule foreach "git commit -am \"Release $RELEASE_TAG\" || true" git commit -am "Release $RELEASE_TAG" mkdir patches -mv taglist.log $PATCH_DIR -modules=`xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' pom.xml` +mv taglist.log "$PATCH_DIR" +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 - git bundle create $PATCH_DIR/${module//\//-}.bundle "origin/master..HEAD" + pushd "$module" + git format-patch --stdout "origin/$RELEASE_BRANCH" > "$PATCH_DIR/${module//\//-}.patch" + git bundle create "$PATCH_DIR/${module//\//-}.bundle" "origin/master..HEAD" popd done -tar cvzf all-bundles.tar.gz `find $PATCH_DIR -type f -print0 \ - | xargs -0r file \ - | egrep -e ':.*Git bundle.*' \ - | cut -d: -f1` -rm $PATCH_DIR/*.bundle - -./scripts/fix-relativepaths.sh +tar cvzf patches.tar.gz -C "$WORKSPACE" patches +rm "$PATCH_DIR"/*.bundle