From a9412b32f3489ac2bc078173a3ec67639d0c235e Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Sun, 5 Mar 2017 16:06:09 +0100 Subject: [PATCH] Allow web servers to be suppressed in runnodes --- .../main/resources/net/corda/plugins/runnodes | 32 +++++++++++-------- .../resources/net/corda/plugins/runnodes.bat | 4 ++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes b/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes index d4b119cd8e..e1cce32921 100755 --- a/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes +++ b/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes @@ -16,17 +16,7 @@ if which osascript >/dev/null; then rootdir=`pwd` for dir in `ls`; do if [ -d $dir ]; then - cmd="bash -c 'cd $rootdir/$dir; /usr/libexec/java_home -v 1.8 --exec java -jar NODEJAR_NAME && exit'" - script="$script - tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down - delay 0.5 - do script \"$cmd\" in window 1" - first=false - fi - done - for dir in `ls`; do - if [ -d $dir ]; then - cmd="bash -c 'cd $rootdir/$dir; /usr/libexec/java_home -v 1.8 --exec java -jar WEBJAR_NAME && exit'" + cmd="bash -c 'cd $rootdir/$dir; exec ./NODEJAR_NAME && exit'" script="$script tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down delay 0.5 @@ -34,6 +24,20 @@ if which osascript >/dev/null; then first=false fi done + + # Now do the web servers. + if [[ "${NO_WEB_SERVER:-}" == "" ]]; then + for dir in `ls`; do + if [ -d $dir ]; then + cmd="bash -c 'cd $rootdir/$dir; /usr/libexec/java_home -v 1.8 --exec java -jar WEBJAR_NAME && exit'" + script="$script + tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down + delay 0.5 + do script \"$cmd\" in window 1" + first=false + fi + done + fi script="$script end tell" osascript -e "$script" @@ -48,8 +52,10 @@ else for dir in `ls`; do if [ -d $dir ]; then pushd $dir >/dev/null - xterm -T "`basename $dir`" -e 'java -jar NODEJAR_NAME' & - xterm -T "`basename $dir` Web Server" -e 'java -jar WEBJAR_NAME' & + xterm -T "`basename $dir`" -e './NODEJAR_NAME' & + if [[ "${NO_WEB_SERVER:-}" == "" ]]; then + xterm -T "`basename $dir` Web Server" -e 'java -jar WEBJAR_NAME' & + fi popd >/dev/null fi done diff --git a/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes.bat b/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes.bat index 0ef95a476d..968655aadf 100644 --- a/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes.bat +++ b/gradle-plugins/cordformation/src/main/resources/net/corda/plugins/runnodes.bat @@ -6,7 +6,9 @@ Pushd %~dp0 FOR /D %%G in (.\*) DO ( Pushd %%G start java -jar NODEJAR_NAME - start java -jar WEBJAR_NAME + IF NOT DEFINED NO_WEB_SERVER ( + start java -jar WEBJAR_NAME + ) Popd )