Modify 'onos-setup-karaf clean' to copy package configs
Running onos-setup-karaf clean deletes the karaf directory and any custom configs
you may have put in there. This change allow a developer to put custom configs
in the usual place ($ONOS_ROOT/tools/package/{config,etc}/) and have them copied
automatically to the local Karaf installation.
Change-Id: I9d7feabdee8f8a89930b9955de610dc821d8fdbb
diff --git a/tools/dev/bin/onos-setup-karaf b/tools/dev/bin/onos-setup-karaf
index 1d82c1d..3323d9d 100755
--- a/tools/dev/bin/onos-setup-karaf
+++ b/tools/dev/bin/onos-setup-karaf
@@ -23,6 +23,7 @@
# Clean the previous Karaf directory if requested and if it exists.
if [ "$1" = "clean" ]; then
shift
+ CLEAN="true"
[ -d $KARAF_ROOT ] && rm -fr $KARAF_ROOT $STAGE/apps $STAGE/config
fi
@@ -105,6 +106,12 @@
"partitions": { "p1": [ { "ip": "$IP", "id": "$IP", "tcpPort": 9876 }]}}
EOF
+if [ "$CLEAN" = "true" ]; then
+ echo "Copying package configs..."
+ cp -r $ONOS_ROOT/tools/package/etc/* $KARAF_ROOT/etc/
+ cp -r $ONOS_ROOT/tools/package/config/* $STAGE/config/
+fi
+
echo "Staging builtin apps..."
rm -fr $STAGE/apps
onos-stage-apps $STAGE/apps $KARAF_ROOT/system