blob: e482df92c1022e7a112bbacf46427dc9651df948 [file] [log] [blame]
Thomas Vachuska683b31b2015-01-26 11:54:31 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Drives the ONOS snapshot process.
4# -----------------------------------------------------------------------------
5
Brian O'Connorf5d93632015-09-04 20:18:31 -07006set -e
7
Thomas Vachuska683b31b2015-01-26 11:54:31 -08008[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
9. $ONOS_ROOT/tools/build/envDefaults
10
11export NEW_VERSION=$1
12[ -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 not 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
23
24# Commit newly versioned artifacts.
25git commit -a -m"Starting snapshot $NEW_VERSION"
26
27# TODO: push?