Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 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 | |
Brian O'Connor | 608e03a | 2015-05-21 17:56:07 -0700 | [diff] [blame] | 9 | set -e |
| 10 | |
Brian O'Connor | d730b22 | 2016-03-01 18:32:38 -0800 | [diff] [blame] | 11 | export NEW_VERSION=${1:-$ONOS_VERSION} |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 12 | [ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 |
| 13 | |
| 14 | export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} |
| 15 | [ "$NEW_VERSION" != "$NEW_VERSION_SHORT" ] && echo "Version is a SNAPSHOT" && exit 1; |
| 16 | |
| 17 | cd $ONOS_ROOT |
| 18 | |
| 19 | # TODO: Create a new branch for this activity? |
| 20 | |
| 21 | # Change the version |
| 22 | onos-change-version $NEW_VERSION |
Brian O'Connor | 6b30e1b | 2015-03-11 16:44:16 -0700 | [diff] [blame] | 23 | export ONOS_VERSION=$NEW_VERSION |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 24 | |
Thomas Vachuska | f765933 | 2016-03-02 00:36:55 -0800 | [diff] [blame] | 25 | # Validate integrity of the versioning |
| 26 | onos-validate-change-version |
| 27 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 28 | # Build ONOS & deploy to staging repo using the release profile. |
Thomas Vachuska | be1a196 | 2016-10-25 16:59:29 -0700 | [diff] [blame] | 29 | onos-buck build onos |
| 30 | time onos-buck-publish |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 31 | |
| 32 | # Build ONOS docs |
Thomas Vachuska | be1a196 | 2016-10-25 16:59:29 -0700 | [diff] [blame] | 33 | onos-buck build //docs:internal //docs:external |
| 34 | |
| 35 | # Package test tar.gz |
| 36 | onos-buck build //:onos-test |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 37 | |
| 38 | # Build ONOS archetypes & deploy to staging repo using the release profile. |
| 39 | # Note that release of the staging repository is a separate manual step. |
Brian O'Connor | 3e18147 | 2016-11-22 13:55:51 -0800 | [diff] [blame] | 40 | export MVN_CLI_OPTS=-Pstaging |
Brian O'Connor | d783f2f | 2015-03-17 19:11:40 -0700 | [diff] [blame] | 41 | pushd tools/package/archetypes/ |
Brian O'Connor | 3e18147 | 2016-11-22 13:55:51 -0800 | [diff] [blame] | 42 | mvn -Pstaging clean install && onos-archetypes-test && mvn -Pstaging -Prelease clean deploy |
Brian O'Connor | d783f2f | 2015-03-17 19:11:40 -0700 | [diff] [blame] | 43 | popd |
Brian O'Connor | 3e18147 | 2016-11-22 13:55:51 -0800 | [diff] [blame] | 44 | unset MVN_CLI_OPTS |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 45 | |
| 46 | # Commit newly versioned artifacts and issue a tag. |
| 47 | git commit -a -m"Tagging $NEW_VERSION" |
| 48 | git tag -sm"Tagging $NEW_VERSION" $NEW_VERSION #signed tag |
| 49 | |
| 50 | # TODO: push? |