From: Thanh Ha Date: Thu, 3 Dec 2015 21:23:41 +0000 (-0500) Subject: Update release scripts to match stable/lithium X-Git-Tag: v0.0.6~43 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F4107%2F1;p=releng%2Flftools.git Update release scripts to match stable/lithium Change-Id: I0e7d08594c72e79c93ca244288addce4c329a83d Signed-off-by: Thanh Ha --- diff --git a/odl-patches.sh b/odl-patches.sh deleted file mode 100755 index 86bf6f18..00000000 --- a/odl-patches.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -project=${PWD##*/} - -git apply /tmp/patches/${project}.patch -git commit -asm "Applying the Helium SR2 release patch" -find . -name pom.xml | xargs grep SNAPSHOT -version-bump.sh -git commit -asm "Bumping versions by 0.0.1 after the Helium SR2 release" -find . -name pom.xml | xargs grep Helium - diff --git a/patch-odl-release.sh b/patch-odl-release.sh new file mode 100755 index 00000000..fd351d93 --- /dev/null +++ b/patch-odl-release.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# @License EPL-1.0 +############################################################################## +# Copyright (c) 2015 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 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Thanh Ha - Initial implementation +############################################################################## + +# The purpose of this patch is to: +# +# 1) Apply autorelease patches for a ODL Release +# 2) Create version bump commit for post-release dev cycle + +USAGE="USAGE: patch-odl-release \n\ +\n\ +path-to-patches - The path to the directory containing ODL Release patches\n\ +tag - example: Lithium-SR1" + +if [ -z "$2" ] +then + echo -e "$USAGE" + exit 1 +fi + +PATCH_DIR=$1 +RELEASE_TAG=$2 + +project=${PWD##*/} +scriptdir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +# Validate that we're patching at the same commit level as when autorelease +# built the release. Basically ensuring that no new patches snuck into the +# project during code freeze. +CURRENT_HASH=`git rev-parse HEAD` +EXPECTED_HASH=`grep $project $PATCH_DIR/taglist.log | awk '{ print $2 }'` +echo "Current Hash: $CURRENT_HASH" +echo "Expected Hash: $EXPECTED_HASH" +if [ "$CURRENT_HASH" != "$EXPECTED_HASH" ] +then + echo "ERROR: Current project hash does not match expected hash" + exit 1 +fi + +####################### +# Start apply patches # +####################### + +git apply ${PATCH_DIR}/${project}.patch +git commit -asm "Release $RELEASE_TAG" +git tag -asm "OpenDaylight $RELEASE_TAG release" release/${RELEASE_TAG,,} +find . -name pom.xml | xargs grep SNAPSHOT +$scriptdir/version.sh bump $RELEASE_TAG +git commit -asm "Bumping versions by 0.0.1 for next dev cycle" +find . -name pom.xml | xargs grep $RELEASE_TAG + diff --git a/version.sh b/version.sh index c07d0adf..d3e11075 100755 --- a/version.sh +++ b/version.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # @License EPL-1.0 ############################################################################## @@ -53,7 +53,7 @@ RELEASE_TAG=$2 FILENAMES="pom.xml features.xml" -if [ "$MODE" = "bump" ] +if [ "$MODE" == "bump" ] then echo "Bumping versions..." for name in $FILENAMES @@ -75,7 +75,7 @@ then find . -type f -name "$name" -exec perl -i -pe "s/(\d\d\d\d\.\d\d\.\d\d)\.(\d+)\.(\d+)-$RELEASE_TAG/\$1.\$2.@{[1+\$3]}-SNAPSHOT/g" {} + find . -type f -name "$name" -exec perl -i -pe "s/(\d\d\d\d\.\d\d\.\d\d)\.(\d+)-$RELEASE_TAG/\$1.\$2.1-SNAPSHOT/g" {} + done -elif [ "$MODE" = "release" ] +elif [ "$MODE" == "release" ] then for name in $FILENAMES do