blob: cc19a4d3bb16bee16752673488edfeec672bf72d [file] [log] [blame]
tom6a9f2722014-09-13 17:00:02 -07001#!/bin/bash
2# ONOS developer BASH profile conveniences
3
4# Root of the ONOS source tree
5export ONOS_ROOT=${ONOS_ROOT:-~/onos-next}
6
7# Setup some environmental context for developers
8export JAVA_HOME=$(/usr/libexec/java_home)
9export MAVEN=${MAVEN:-~/Applications/apache-maven-3.2.2}
10export KARAF=${KARAF:-~/Applications/apache-karaf-3.0.1}
11export KARAF_LOG=$KARAF/data/log/karaf.log
12
13# Setup a path
14export PS=":"
tom5c255702014-09-18 06:57:39 -070015export PATH="$PATH:$ONOS_ROOT/tools/dev:$ONOS_ROOT/tools/build"
16export PATH="$PATH:$ONOS_ROOT/tools/test/bin"
tom6a9f2722014-09-13 17:00:02 -070017export PATH="$PATH:$MAVEN/bin:$KARAF/bin"
18export PATH="$PATH:."
19
20# Convenience utility to warp to various ONOS source projects
21# e.g. 'o api', 'o dev', 'o'
22function o {
23 cd $(find $ONOS_ROOT/ -type d | egrep -v '.git|target|src' | \
24 egrep "${1:-$ONOS_ROOT}" | head -n 1)
25}
26
27# Short-hand for 'mvn clean install' for us lazy folk
28alias mci='mvn clean install'
29
30# Short-hand for ONOS build from the top of the source tree.
31alias ob='o && mvn clean install javadoc:aggregate'
32
33# Short-hand for tailing the ONOS (karaf) log
34alias tl='$ONOS_ROOT/tools/dev/watchLog'
35alias tlo='tl | grep --colour=always org.onlab'
36
37# Pretty-print JSON output
38alias pp='python -m json.tool'
39
40# Short-hand to launch API docs and sample topology viewer GUI
41alias docs='open $ONOS_ROOT/target/site/apidocs/index.html'
42alias gui='open http://localhost:8181/onos/tvue'
tom5c255702014-09-18 06:57:39 -070043
44
45# Miscellaneous
46function spy {
47 ps -ef | egrep "$@" | grep -v egrep
48}
49
50function nuke {
51 spy | cut -c7-11 | xargs kill
52}