blob: 48676cc678b8d248992be26ee606fbce4fe81902 [file] [log] [blame]
Thomas Vachuska683b31b2015-01-26 11:54:31 -08001#!/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
Brian O'Connor608e03a2015-05-21 17:56:07 -07009set -e
10
Brian O'Connord730b222016-03-01 18:32:38 -080011export NEW_VERSION=${1:-$ONOS_VERSION}
Thomas Vachuska683b31b2015-01-26 11:54:31 -080012[ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1
13
14export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT}
15[ "$NEW_VERSION" != "$NEW_VERSION_SHORT" ] && echo "Version is a SNAPSHOT" && exit 1;
16
17cd $ONOS_ROOT
18
19# TODO: Create a new branch for this activity?
20
21# Change the version
22onos-change-version $NEW_VERSION
Brian O'Connor6b30e1b2015-03-11 16:44:16 -070023export ONOS_VERSION=$NEW_VERSION
Thomas Vachuska683b31b2015-01-26 11:54:31 -080024
25# Build ONOS & deploy to staging repo using the release profile.
Brian O'Connor3be2cc52015-12-11 17:09:05 -080026onos-build && onos-package --tar --zip && mvn -Prelease clean deploy -DskipTests
Thomas Vachuska683b31b2015-01-26 11:54:31 -080027
28# Build ONOS docs
29onos-build-docs
30
31# Build ONOS archetypes & deploy to staging repo using the release profile.
32# Note that release of the staging repository is a separate manual step.
Brian O'Connord783f2f2015-03-17 19:11:40 -070033pushd tools/package/archetypes/
Brian O'Connord4cd0bf2015-02-28 23:13:48 -080034mvn clean install && onos-archetypes-test && mvn -Prelease clean deploy
Brian O'Connord783f2f2015-03-17 19:11:40 -070035popd
Thomas Vachuska683b31b2015-01-26 11:54:31 -080036
37# Commit newly versioned artifacts and issue a tag.
38git commit -a -m"Tagging $NEW_VERSION"
39git tag -sm"Tagging $NEW_VERSION" $NEW_VERSION #signed tag
40
41# TODO: push?