Brian O'Connor
Committed by Gerrit Code Review

Updating scripts for release

Change-Id: I5c3cfb60d10de03e3f60643bb6d655869ccc8562
1 #!/bin/bash 1 #!/bin/bash
2 +# ----------------------------------------------------
3 +# Used to update the project's refs/meta/config
4 +# ----------------------------------------------------
5 +
6 +set -e
2 7
3 GERRIT_USER=${GERRIT_USER:-$USER} 8 GERRIT_USER=${GERRIT_USER:-$USER}
4 GERRIT_PROJECT=${GERRIT_PROJECT:-onos} 9 GERRIT_PROJECT=${GERRIT_PROJECT:-onos}
......
1 +#!/bin/bash
2 +# --------------------------------------------------------
3 +# Creates a tempdir for release and checks out the code
4 +# --------------------------------------------------------
5 +
6 +set -e
7 +
8 +GERRIT_USER=${GERRIT_USER:-$USER}
9 +BRANCH=${2:-master}
10 +
11 +export ONOS_VERSION=${1:-$ONOS_VERSION}
12 +if [ -z "$ONOS_VERSION" ]; then
13 + echo "USAGE: onos-prepare-release <version number>"
14 + echo " Alternatively, ONOS_VERSION must be set"
15 + exit -1
16 +fi
17 +
18 +DIR=$(mktemp -d /tmp/onos-release.XXXXX) &&
19 + echo "Created tempdir for release: $DIR" ||
20 + { echo "Failed to create temp file"; exit 1; }
21 +
22 +cd $DIR
23 +git init
24 +git remote add origin ssh://$GERRIT_USER@gerrit.onosproject.org:29418/onos.git
25 +git fetch origin
26 +git checkout $BRANCH
27 +
28 +# Check existance of version
29 +git tag -l | grep -q $ONOS_VERSION && { echo "ERROR: Version already exists"; exit -1; }
30 +
31 +export ONOS_ROOT=$DIR
32 +exec bash -i
33 +
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
8 8
9 set -e 9 set -e
10 10
11 -export NEW_VERSION=$1 11 +export NEW_VERSION=${1:-$ONOS_VERSION}
12 [ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 12 [ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1
13 13
14 export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} 14 export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT}
......