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 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
while getopts fn o; do
while getopts fnm: o; do
case "$o" in
f) uninstall=true;;
n) nostart=true;;
m) mvn_settings=$OPTARG;;
esac
done
let OPC=$OPTIND-1
......@@ -23,6 +24,8 @@ remote=$ONOS_USER@$node
$(dirname $0)/onos-push-bits $node
[ ! -z "$mvn_settings" ] && scp -q $mvn_settings $remote:/tmp/settings.xml
ssh $remote "
[ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1
......@@ -50,6 +53,8 @@ ssh $remote "
rm -fr ~/.m2/repository/org/onosproject
cp -r $ONOS_INSTALL_DIR/$KARAF_DIST/system/org/onosproject ~/.m2/repository/org/onosproject
[ ! -z "$mvn_settings" ] && cp /tmp/settings.xml ~/.m2/settings.xml
# Drop log level for the console
echo "log4j.logger.org.apache.sshd = WARN" \
>> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg
......