Thomas Vachuska

Adding tool to test release readiness.

Fixing minor issues with onos-upload-docs and envDefaults.

Change-Id: I6bc0ba4cebab625cd371ebbf58f356541e75b859
...@@ -11,8 +11,8 @@ export KARAF_TAR=${KARAF_TAR:-~/Downloads/apache-karaf-$KARAF_VERSION.tar.gz} ...@@ -11,8 +11,8 @@ export KARAF_TAR=${KARAF_TAR:-~/Downloads/apache-karaf-$KARAF_VERSION.tar.gz}
11 export KARAF_DIST=$(basename $KARAF_ZIP .zip) 11 export KARAF_DIST=$(basename $KARAF_ZIP .zip)
12 12
13 # Add ONOS-specific directories to the exectable PATH 13 # Add ONOS-specific directories to the exectable PATH
14 -export PATH="$PATH:$ONOS_ROOT/tools/dev/bin:$ONOS_ROOT/tools/test/bin" 14 +export PATH="$ONOS_ROOT/tools/dev/bin:$ONOS_ROOT/tools/test/bin:$PATH"
15 -export PATH="$PATH:$ONOS_ROOT/tools/build" 15 +export PATH="$ONOS_ROOT/tools/build:$PATH"
16 16
17 # Fallback build number us derived from from the user name & time 17 # Fallback build number us derived from from the user name & time
18 export BUILD_NUMBER=${BUILD_NUMBER:-$(id -un)~$(date +'%Y/%m/%d@%H:%M')} 18 export BUILD_NUMBER=${BUILD_NUMBER:-$(id -un)~$(date +'%Y/%m/%d@%H:%M')}
......
1 +#!/bin/bash
2 +# -----------------------------------------------------------------------------
3 +# Validates that the local environment is ready to commence release process.
4 +# -----------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +
8 +GERRIT_USER=${GERRIT_USER:-$USER}
9 +
10 +set -e
11 +
12 +# Test access to Gerrit (Administrator)
13 +function testGerritAccess {
14 + trap "echo 'FAILED'" ERR
15 + printf "Checking Gerrit Administrator access... "
16 + ssh -p 29418 gerrit.onosproject.org gerrit ls-members Administrators \
17 + --recursive | grep -q $GERRIT_USER
18 + echo "OK"
19 +}
20 +
21 +# Test access to wiki.onosproject.org
22 +function testWikiAccess {
23 + trap "echo 'FAILED'" ERR
24 + printf "Checking Wiki access... "
25 + ssh $USER@api.onosproject.org "test -w /var/www/api/index.html"
26 + echo "OK"
27 +}
28 +
29 +# Test access to EC2
30 +function testEC2Access {
31 + aux=$(mktemp)
32 + trap "cat $aux; rm -f $aux; echo 'FAILED'" ERR
33 + printf "Checking EC2 access... "
34 + uploadToS3.py -v 1>$aux 2>&1
35 + rm -f $aux
36 + echo "OK"
37 +}
38 +
39 +# Sonatype account must be created & ~/.m2/settings.xml must be configured
40 +# Test by "releasing" a fake project setup for that purpose to validate access.
41 +function testSonatypeAccess {
42 + aux=$(mktemp)
43 + trap "cat $aux; rm -f $aux; echo 'FAILED'" ERR
44 + printf "Checking Sonatype access... "
45 + pushd $ONOS_ROOT/tools/build/release-test >/dev/null
46 + # TODO: Figure out how to supress the GPG note
47 + mvn -Prelease clean deploy org.sonatype.plugins:nexus-staging-maven-plugin:drop \
48 + 1>$aux 2>&1 </dev/null
49 + mvn clean >/dev/null
50 + rm -f $aux
51 + popd >/dev/null
52 + echo "OK"
53 +}
54 +
55 +testGerritAccess
56 +testWikiAccess
57 +testEC2Access
58 +testSonatypeAccess
59 +
60 +echo "Ready to commence release process!"
61 +
...@@ -8,7 +8,7 @@ set -e ...@@ -8,7 +8,7 @@ set -e
8 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 8 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
9 . $ONOS_ROOT/tools/build/envDefaults 9 . $ONOS_ROOT/tools/build/envDefaults
10 10
11 -user=${1:-jenkins} 11 +user=${1:-$USER}
12 remote=$user@wiki.onosproject.org 12 remote=$user@wiki.onosproject.org
13 13
14 scp $ONOS_ROOT/docs/target/onos-apidocs-$ONOS_VERSION.tar.gz $remote:/tmp 14 scp $ONOS_ROOT/docs/target/onos-apidocs-$ONOS_VERSION.tar.gz $remote:/tmp
......