blob: d903b0b044ff4e5f6b29b63b6630d307c604b912 [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}
Ray Milkey13d3ae32017-01-03 15:00:04 -080012DRY_RUN=${2:-""}
13dryRun=0
14if [ "${DRY_RUN}" == "--dry-run" ]; then
15 dryRun=1
16fi
17
Thomas Vachuska683b31b2015-01-26 11:54:31 -080018[ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1
19
20export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT}
21[ "$NEW_VERSION" != "$NEW_VERSION_SHORT" ] && echo "Version is a SNAPSHOT" && exit 1;
22
23cd $ONOS_ROOT
24
25# TODO: Create a new branch for this activity?
26
27# Change the version
28onos-change-version $NEW_VERSION
Brian O'Connor6b30e1b2015-03-11 16:44:16 -070029export ONOS_VERSION=$NEW_VERSION
Thomas Vachuska683b31b2015-01-26 11:54:31 -080030
Thomas Vachuskaf7659332016-03-02 00:36:55 -080031# Validate integrity of the versioning
32onos-validate-change-version
33
Thomas Vachuska683b31b2015-01-26 11:54:31 -080034# Build ONOS & deploy to staging repo using the release profile.
Thomas Vachuskabe1a1962016-10-25 16:59:29 -070035onos-buck build onos
Ray Milkey13d3ae32017-01-03 15:00:04 -080036
37if [ $dryRun -eq 0 ]; then
38 time onos-buck-publish
39else
40 time onos-buck-publish-local
41fi
Thomas Vachuska683b31b2015-01-26 11:54:31 -080042
43# Build ONOS docs
Thomas Vachuskabe1a1962016-10-25 16:59:29 -070044onos-buck build //docs:internal //docs:external
45
46# Package test tar.gz
47onos-buck build //:onos-test
Thomas Vachuska683b31b2015-01-26 11:54:31 -080048
49# Build ONOS archetypes & deploy to staging repo using the release profile.
50# Note that release of the staging repository is a separate manual step.
Brian O'Connor3e181472016-11-22 13:55:51 -080051export MVN_CLI_OPTS=-Pstaging
Brian O'Connord783f2f2015-03-17 19:11:40 -070052pushd tools/package/archetypes/
Brian O'Connor3e181472016-11-22 13:55:51 -080053mvn -Pstaging clean install && onos-archetypes-test && mvn -Pstaging -Prelease clean deploy
Brian O'Connord783f2f2015-03-17 19:11:40 -070054popd
Brian O'Connor3e181472016-11-22 13:55:51 -080055unset MVN_CLI_OPTS
Thomas Vachuska683b31b2015-01-26 11:54:31 -080056
57# Commit newly versioned artifacts and issue a tag.
58git commit -a -m"Tagging $NEW_VERSION"
59git tag -sm"Tagging $NEW_VERSION" $NEW_VERSION #signed tag
60
61# TODO: push?