Enable remote debugging for onapcli 87/8487/1
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>
Wed, 23 Aug 2017 19:54:03 +0000 (01:24 +0530)
committersubhash kumar singh <subhash.kumar.singh@huawei.com>
Wed, 23 Aug 2017 19:56:21 +0000 (01:26 +0530)
Enable remote debugging for onapcli.
Introduce following two environment variable:

ONAP_CLI_DEBUG: set true to enable remote debugging.
ONAP_CLI_DEBUG: set remote debugging port (default 5005).

Issue-Id: CLI-36
Change-Id: I971d3bd22d283c44da307896c20ae75e42c51bef
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
deployment/zip/src/main/release/bin/onap.sh

index e897084..9650ccd 100644 (file)
@@ -28,4 +28,10 @@ do
   CLASSPATH=$CLASSPATH:$entry
 done
 
-java -classpath $CLASSPATH org.onap.cli.main.OnapCli "$@"
+if [ "$ONAP_CLI_DEBUG" = "true" ]
+then
+    ${ONAP_CLI_DEBUG_PORT:=5005}
+    java -Xdebug -Xrunjdwp:transport=dt_socket,address=$ONAP_CLI_DEBUG_PORT,server=y -classpath $CLASSPATH org.onap.cli.main.OnapCli "$@"
+else
+    java -classpath $CLASSPATH org.onap.cli.main.OnapCli "$@"
+fi