#!/bin/bash # ----------------------------------------------------------------------------- # Changes ONOS version in POM files, and other release artifacts. # ----------------------------------------------------------------------------- set -e [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 . $ONOS_ROOT/tools/build/envDefaults export NEW_VERSION=$1 [ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} cd $ONOS_ROOT # Augment the version of the main pom and the modules nested underneath. mvn versions:set -DnewVersion=$NEW_VERSION versions:commit # Augment the version of the Java API pom files and the overview.html file. for pom in docs/internal.xml docs/external.xml; do sed -i "" -E "1,//s/[^<]*$NEW_VERSION/s/ONOS Java API[^<]*ONOS Java API ($NEW_VERSION)/s/[^<]*$NEW_VERSIONcord-gui<.*\n.*version>#cord-gui\n $NEW_VERSION#" $ONOS_ROOT/apps/demo/cord-gui/pom.xml sed -i "" -E "s#demo/cord-gui/target/cord-gui-.*\.war#demo/cord-gui/target/cord-gui-$NEW_VERSION.war#" $ONOS_ROOT/apps/demo/cord-gui/src/scripts/pullwar.sh sed -i "" -E "s#CORD=./cord-gui-.*\.war#CORD=./cord-gui-$NEW_VERSION.war#" $ONOS_ROOT/apps/demo/cord-gui/src/scripts/run.me # Augment the acl app sed -i "" -E "s/[^<]*$NEW_VERSION