Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Drives the ONOS snapshot process. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
Brian O'Connor | f5d9363 | 2015-09-04 20:18:31 -0700 | [diff] [blame^] | 6 | set -e |
| 7 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 8 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 9 | . $ONOS_ROOT/tools/build/envDefaults |
| 10 | |
| 11 | export NEW_VERSION=$1 |
| 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 not 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 |
| 23 | |
| 24 | # Commit newly versioned artifacts. |
| 25 | git commit -a -m"Starting snapshot $NEW_VERSION" |
| 26 | |
| 27 | # TODO: push? |