Kenji HIKICHI

ONOS-534: onos-install: add a new option to copy maven's setting file

* Added a option "-m <setting-file>" to the onos-install command
  to copy the <setting-file> to ~/.m2/settings.xml on remote node.

Change-Id: Ibad240004bae2d5f415bfaf0f23ee0f822c010d2
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 . $ONOS_ROOT/tools/build/envDefaults 7 . $ONOS_ROOT/tools/build/envDefaults
8 8
9 -while getopts fn o; do 9 +while getopts fnm: o; do
10 case "$o" in 10 case "$o" in
11 f) uninstall=true;; 11 f) uninstall=true;;
12 n) nostart=true;; 12 n) nostart=true;;
13 + m) mvn_settings=$OPTARG;;
13 esac 14 esac
14 done 15 done
15 let OPC=$OPTIND-1 16 let OPC=$OPTIND-1
...@@ -23,6 +24,8 @@ remote=$ONOS_USER@$node ...@@ -23,6 +24,8 @@ remote=$ONOS_USER@$node
23 24
24 $(dirname $0)/onos-push-bits $node 25 $(dirname $0)/onos-push-bits $node
25 26
27 +[ ! -z "$mvn_settings" ] && scp -q $mvn_settings $remote:/tmp/settings.xml
28 +
26 ssh $remote " 29 ssh $remote "
27 [ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1 30 [ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1
28 31
...@@ -50,6 +53,8 @@ ssh $remote " ...@@ -50,6 +53,8 @@ ssh $remote "
50 rm -fr ~/.m2/repository/org/onosproject 53 rm -fr ~/.m2/repository/org/onosproject
51 cp -r $ONOS_INSTALL_DIR/$KARAF_DIST/system/org/onosproject ~/.m2/repository/org/onosproject 54 cp -r $ONOS_INSTALL_DIR/$KARAF_DIST/system/org/onosproject ~/.m2/repository/org/onosproject
52 55
56 + [ ! -z "$mvn_settings" ] && cp /tmp/settings.xml ~/.m2/settings.xml
57 +
53 # Drop log level for the console 58 # Drop log level for the console
54 echo "log4j.logger.org.apache.sshd = WARN" \ 59 echo "log4j.logger.org.apache.sshd = WARN" \
55 >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg 60 >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg
......