Thomas Vachuska | fcd6114 | 2015-04-23 13:59:08 -0700 | [diff] [blame] | 1 | #!/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 HIGUCHI | b4bf7c8 | 2016-07-01 20:49:19 -0700 | [diff] [blame] | 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | if [ -L $ONOS_TAR ]; then |
| 9 | echo "WARN: This script does not support deploying buck artifacts" |
| 10 | fi |
| 11 | |
Yuta HIGUCHI | 7d8b3b1 | 2016-09-12 13:09:47 -0700 | [diff] [blame] | 12 | SETUP_OPTS="" |
Jian Li | 8bf6c44 | 2016-04-06 12:01:39 -0700 | [diff] [blame] | 13 | # FIXME: temporarily fix 500 error in GUI, need to be improved with a better way |
| 14 | if echo $* | egrep "\bclean\b"; then |
Jian Li | 8bf6c44 | 2016-04-06 12:01:39 -0700 | [diff] [blame] | 15 | 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 HIGUCHI | 7d8b3b1 | 2016-09-12 13:09:47 -0700 | [diff] [blame] | 19 | SETUP_OPTS="${SETUP_OPTS} clean" |
Jian Li | 8bf6c44 | 2016-04-06 12:01:39 -0700 | [diff] [blame] | 20 | fi |
| 21 | |
Yuta HIGUCHI | 7d8b3b1 | 2016-09-12 13:09:47 -0700 | [diff] [blame] | 22 | onos-setup-karaf $SETUP_OPTS && karaf "$@" |