Ray Milkey | 8db3c10 | 2017-11-02 13:08:20 -0700 | [diff] [blame] | 1 | #!/bin/bash -ex |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 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} |
Ray Milkey | 13d3ae3 | 2017-01-03 15:00:04 -0800 | [diff] [blame] | 12 | DRY_RUN=${2:-""} |
| 13 | dryRun=0 |
| 14 | if [ "${DRY_RUN}" == "--dry-run" ]; then |
| 15 | dryRun=1 |
| 16 | fi |
| 17 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 18 | [ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 |
| 19 | |
| 20 | export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} |
| 21 | [ "$NEW_VERSION" != "$NEW_VERSION_SHORT" ] && echo "Version is a SNAPSHOT" && exit 1; |
| 22 | |
| 23 | cd $ONOS_ROOT |
| 24 | |
| 25 | # TODO: Create a new branch for this activity? |
| 26 | |
| 27 | # Change the version |
| 28 | onos-change-version $NEW_VERSION |
Brian O'Connor | 6b30e1b | 2015-03-11 16:44:16 -0700 | [diff] [blame] | 29 | export ONOS_VERSION=$NEW_VERSION |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 30 | |
Thomas Vachuska | f765933 | 2016-03-02 00:36:55 -0800 | [diff] [blame] | 31 | # Validate integrity of the versioning |
| 32 | onos-validate-change-version |
| 33 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 34 | # Build ONOS & deploy to staging repo using the release profile. |
Thomas Vachuska | be1a196 | 2016-10-25 16:59:29 -0700 | [diff] [blame] | 35 | onos-buck build onos |
Ray Milkey | 13d3ae3 | 2017-01-03 15:00:04 -0800 | [diff] [blame] | 36 | |
| 37 | if [ $dryRun -eq 0 ]; then |
| 38 | time onos-buck-publish |
| 39 | else |
| 40 | time onos-buck-publish-local |
| 41 | fi |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 42 | |
| 43 | # Build ONOS docs |
Thomas Vachuska | be1a196 | 2016-10-25 16:59:29 -0700 | [diff] [blame] | 44 | onos-buck build //docs:internal //docs:external |
| 45 | |
| 46 | # Package test tar.gz |
| 47 | onos-buck build //:onos-test |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 48 | |
Thomas Vachuska | bee8a91 | 2018-02-28 10:02:16 -0800 | [diff] [blame] | 49 | # Package admin tar.gz |
| 50 | onos-buck build //:onos-admin |
| 51 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 52 | # Build ONOS archetypes & deploy to staging repo using the release profile. |
| 53 | # Note that release of the staging repository is a separate manual step. |
Ray Milkey | f3aba5f | 2017-01-09 16:47:14 -0800 | [diff] [blame] | 54 | if [ $dryRun -eq 0 ]; then |
| 55 | export MVN_CLI_OPTS=-Pstaging |
| 56 | pushd tools/package/archetypes/ |
| 57 | mvn -Pstaging clean install && onos-archetypes-test && mvn -Pstaging -Prelease clean deploy |
| 58 | popd |
| 59 | unset MVN_CLI_OPTS |
| 60 | else |
| 61 | pushd tools/package/archetypes/ |
| 62 | mvn clean install && onos-archetypes-test |
| 63 | popd |
| 64 | fi |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 65 | |
Ray Milkey | d341e61 | 2017-11-02 15:03:56 -0700 | [diff] [blame] | 66 | if [ $dryRun -eq 0 ]; then |
| 67 | # Commit newly versioned artifacts and issue a tag. |
| 68 | git commit -a -m"Tagging $NEW_VERSION" |
| 69 | git tag -sm"Tagging $NEW_VERSION" $NEW_VERSION #signed tag |
| 70 | fi |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 71 | |
| 72 | # TODO: push? |