blob: 54b497d193bd3c09ff8f0fedfe56ff263942bd09 [file] [log] [blame]
Thomas Vachuskafcd61142015-04-23 13:59:08 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Makes sure local ONOS karaf instance is primed & staged and then launches
4# karaf using the supplied arguments.
5# -----------------------------------------------------------------------------
6
Yuta HIGUCHIb4bf7c82016-07-01 20:49:19 -07007. $ONOS_ROOT/tools/build/envDefaults
8if [ -L $ONOS_TAR ]; then
9 echo "WARN: This script does not support deploying buck artifacts"
10fi
11
Yuta HIGUCHI7d8b3b12016-09-12 13:09:47 -070012SETUP_OPTS=""
Jian Li8bf6c442016-04-06 12:01:39 -070013# FIXME: temporarily fix 500 error in GUI, need to be improved with a better way
14if echo $* | egrep "\bclean\b"; then
Jian Li8bf6c442016-04-06 12:01:39 -070015 export KARAF_ROOT=${KARAF_ROOT:-~/Applications/apache-karaf-$KARAF_VERSION}
16 export STAGE=$(dirname $KARAF_ROOT)
17 echo "Removing data directories..."
18 [ -d $KARAF_ROOT ] && rm -fr $STAGE/data
Yuta HIGUCHI7d8b3b12016-09-12 13:09:47 -070019 SETUP_OPTS="${SETUP_OPTS} clean"
Jian Li8bf6c442016-04-06 12:01:39 -070020fi
21
Yuta HIGUCHI7d8b3b12016-09-12 13:09:47 -070022onos-setup-karaf $SETUP_OPTS && karaf "$@"