X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fmaven-patch-release.sh;h=4f49b4f55e13ca63e43498b05bed628f15aa2017;hb=04853ec1c27444d494afae28e8c181b711280f4b;hp=f0b26c7a15f2eb843efa416a33b1ed47fb0b8b87;hpb=34ab3807fb760dea4fdfc08b1692d49a243759f1;p=releng%2Fglobal-jjb.git diff --git a/shell/maven-patch-release.sh b/shell/maven-patch-release.sh index f0b26c7a..4f49b4f5 100644 --- a/shell/maven-patch-release.sh +++ b/shell/maven-patch-release.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# @License EPL-1.0 +#!/bin/bash -l +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. # @@ -8,7 +8,7 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## - +echo "---> maven-patch-release.sh" # This script removes the -SNAPSHOT from a project to prepare it for release. PATCH_DIR="$WORKSPACE/archives/patches" @@ -18,10 +18,10 @@ mkdir -p "$PATCH_DIR" set -eu -o pipefail echo "$PROJECT" "$(git rev-parse --verify HEAD)" | tee -a "$PATCH_DIR/taglist.log" - -# Strip -SNAPSHOT from version to prepare release. -find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//g' - +if [[ "${MAVEN_VERSIONS_PLUGIN}" == "false" ]] ; then + # Strip -SNAPSHOT from version to prepare release. + find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//g' +fi git commit -am "Release $PROJECT" git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${PROJECT//\//-}.patch" git bundle create "$PATCH_DIR/${PROJECT//\//-}.bundle" "origin/${GERRIT_BRANCH}..HEAD"