Committed by
Brian O'Connor
Creating tools to aid in ONOS release process.
Change-Id: I6fba9c6cfbd943fead7005fa09eba2d7af6ac821
Showing
6 changed files
with
130 additions
and
1 deletions
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # ----------------------------------------------------------------------------- | 2 | # ----------------------------------------------------------------------------- |
3 | -# Builds the ONOS from source. | 3 | +# Builds the ONOS Java API docs. |
4 | # ----------------------------------------------------------------------------- | 4 | # ----------------------------------------------------------------------------- |
5 | 5 | ||
6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ... | ... |
tools/build/onos-change-version
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Changes ONOS version in POM files, and other release artifacts. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ||
7 | +. $ONOS_ROOT/tools/build/envDefaults | ||
8 | + | ||
9 | +export NEW_VERSION=$1 | ||
10 | +[ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 | ||
11 | + | ||
12 | +export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} | ||
13 | + | ||
14 | +cd $ONOS_ROOT | ||
15 | + | ||
16 | +# Augment the version of the main pom and the modules nested underneath. | ||
17 | +mvn versions:set -DnewVersion=$NEW_VERSION versions:commit | ||
18 | + | ||
19 | +# Augment the version of the Java API pom files and the overview.html file. | ||
20 | +for pom in docs/pom.xml docs/external.xml; do | ||
21 | + sed -i "" -E "1,/<version>/s/<version>[^<]*</<version>$NEW_VERSION</g" $pom | ||
22 | + sed -i "" -E "1,/<doctitle>/s/<doctitle>ONOS Java API[^<]*</<doctitle>ONOS Java API ($NEW_VERSION)</g" $pom | ||
23 | +done | ||
24 | + | ||
25 | +# Augment the version in envDefaults, onos.py and archetypes test | ||
26 | +sed -i "" -E "s/ONOS_VERSION:-[^$]*/ONOS_VERSION:-$NEW_VERSION_SHORT./" $ONOS_ROOT/tools/build/envDefaults | ||
27 | +sed -i "" -E "s/features\/.*\/xml/features\/$NEW_VERSION\/xml/" $ONOS_ROOT/tools/test/topos/onos.py | ||
28 | +sed -i "" -E "s/ -Dversion=.*\"/ -Dversion=$NEW_VERSION\"/" $ONOS_ROOT/tools/test/bin/onos-archetypes-test | ||
29 | + | ||
30 | +# Augment the version in archetypes tree. | ||
31 | +mvn -f tools/package/archetypes/pom.xml versions:set -DnewVersion=$NEW_VERSION versions:commit | ||
32 | +for atype in api bundle cli; do | ||
33 | + pom="tools/package/archetypes/$atype/src/main/resources/archetype-resources/pom.xml" | ||
34 | + sed -i "" -E "1,/<onos.version>/s/<onos.version>[^<]*</<onos.version>$NEW_VERSION</g" $pom | ||
35 | +done | ||
36 | + |
tools/build/onos-release
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Drives the ONOS release process. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ||
7 | +. $ONOS_ROOT/tools/build/envDefaults | ||
8 | + | ||
9 | +export NEW_VERSION=$1 | ||
10 | +[ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 | ||
11 | + | ||
12 | +export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} | ||
13 | +[ "$NEW_VERSION" != "$NEW_VERSION_SHORT" ] && echo "Version is a SNAPSHOT" && exit 1; | ||
14 | + | ||
15 | +cd $ONOS_ROOT | ||
16 | + | ||
17 | +# TODO: Create a new branch for this activity? | ||
18 | + | ||
19 | +# Change the version | ||
20 | +onos-change-version $NEW_VERSION | ||
21 | + | ||
22 | +# Build ONOS & deploy to staging repo using the release profile. | ||
23 | +onos-build && onos-package && mvn -Prelease clean deploy -DskipTests | ||
24 | + | ||
25 | +# Build ONOS docs | ||
26 | +onos-build-docs | ||
27 | + | ||
28 | +# Build ONOS archetypes & deploy to staging repo using the release profile. | ||
29 | +# Note that release of the staging repository is a separate manual step. | ||
30 | +cd tools/package/archetype | ||
31 | +mvn clean install && onos-archetype-test && mvn -Prelease clean deploy | ||
32 | + | ||
33 | +# Commit newly versioned artifacts and issue a tag. | ||
34 | +git commit -a -m"Tagging $NEW_VERSION" | ||
35 | +git tag -sm"Tagging $NEW_VERSION" $NEW_VERSION #signed tag | ||
36 | + | ||
37 | +# TODO: push? |
tools/build/onos-snapshot
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Drives the ONOS snapshot process. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ||
7 | +. $ONOS_ROOT/tools/build/envDefaults | ||
8 | + | ||
9 | +export NEW_VERSION=$1 | ||
10 | +[ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 | ||
11 | + | ||
12 | +export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} | ||
13 | +[ "$NEW_VERSION" = "$NEW_VERSION_SHORT" ] && echo "Version is not a SNAPSHOT" && exit 1; | ||
14 | + | ||
15 | +cd $ONOS_ROOT | ||
16 | + | ||
17 | +# TODO: Create a new branch for this activity? | ||
18 | + | ||
19 | +# Change the version | ||
20 | +onos-change-version $NEW_VERSION | ||
21 | + | ||
22 | +# Commit newly versioned artifacts. | ||
23 | +git commit -a -m"Starting snapshot $NEW_VERSION" | ||
24 | + | ||
25 | +# TODO: push? |
tools/build/onos-upload-bits
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Uploads ONOS distributable bits. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ||
7 | +. $ONOS_ROOT/tools/build/envDefaults | ||
8 | + | ||
9 | +# TODO: upload to EC2 | ||
10 | + |
tools/build/onos-upload-docs
0 → 100755
1 | +#!/bin/bash | ||
2 | +# ----------------------------------------------------------------------------- | ||
3 | +# Uploads ONOS Java API docs. | ||
4 | +# ----------------------------------------------------------------------------- | ||
5 | + | ||
6 | +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | ||
7 | +. $ONOS_ROOT/tools/build/envDefaults | ||
8 | + | ||
9 | +user=${1:-jenkins} | ||
10 | +remote=$user@wiki.onosproject.org | ||
11 | + | ||
12 | +scp $ONOS_ROOT/docs/target/onos-apidocs-$ONOS_VERSION.tar.gz $remote:/tmp | ||
13 | +ssh $remote " | ||
14 | + mkdir -p /var/www/api/$ONOS_VERSION | ||
15 | + cd /var/www/api/$ONOS_VERSION | ||
16 | + tar zxf /tmp/onos-apidocs-$ONOS_VERSION.tar.gz | ||
17 | + mv onos-apidocs-$ONOS_VERSION/* . | ||
18 | + rm -rf onos-apidocs-$ONOS_VERSION | ||
19 | + | ||
20 | + # TODO: optionally bump /var/www/api/index.html | ||
21 | +" |
-
Please register or login to post a comment