From 32e190e0211c675a5bcde2fbb621707f21e4b3c7 Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Wed, 31 Aug 2016 13:38:34 -0700 Subject: [PATCH 1/3] First of several changes --- java-repo-tools/scripts/test-localhost.sh | 35 +++++++++++++++++------ travis.sh | 12 ++++++++ 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/java-repo-tools/scripts/test-localhost.sh b/java-repo-tools/scripts/test-localhost.sh index 742e0df3aa8..7d8af713c04 100755 --- a/java-repo-tools/scripts/test-localhost.sh +++ b/java-repo-tools/scripts/test-localhost.sh @@ -24,9 +24,12 @@ print_usage () { echo " $0 server-type path/to/project [-- maven arguments]" >&2 echo >&2 echo "server-type can be any of the following:" >&2 - echo " appengine" >&2 - echo " jetty" >&2 - echo " spring-boot" >&2 + echo " appengine - GAE Standard - Local - GA Plugin" >&2 + echo " jetty - Flex - Local" >&2 + echo " spring-boot - local" >&2 + echo " new_mvn - local - Standard/Flex" >&2 + echo " gradle - local - Standard" >&2 + echo " gradle_jetty - local - Flex" &2 } if [[ -z "$1" ]]; then @@ -34,19 +37,34 @@ if [[ -z "$1" ]]; then print_usage exit 1 fi +command="mvn --batch-mode clean ${mvn_goal} -DskipTests" case $1 in appengine) - mvn_plugin="appengine:devserver" + mvn_goal="appengine:devserver" server_started_message="localhost:8080" ;; jetty) - mvn_plugin="jetty:run-exploded" + mvn_goal="jetty:run-exploded" server_started_message="Started Jetty Server" ;; spring-boot) - mvn_plugin="spring-boot:run" + mvn_goal="spring-boot:run" server_started_message="Tomcat started on port(s): 8080 (http)" ;; + new_mvn) + mvn_goal="appengine:run" + server_started_message="localhost:8080" + ;; + gradle) + task="appengineRun" + server_started_message="localhost:8080" + command="gradle clean ${mvn_goal}" + ;; + gradle_jetty) + task="jettyRun" + server_started_message="localhost:8080" + command="gradle clean ${task} " + ;; *) print_usage exit 1 @@ -60,11 +78,10 @@ if [[ -z "$2" ]]; then fi code_path=$2 -mvn_command="mvn --batch-mode clean ${mvn_plugin} -DskipTests" if [[ "$3" == "--" ]]; then shift 3 for mvn_arg in "${@}"; do - mvn_command="${mvn_command} ${mvn_arg}" + command="${command} ${mvn_arg}" done elif [[ -n "$3" ]]; then echo "Got unexpected third argument" >&2 @@ -78,7 +95,7 @@ set -x ( cd "$code_path" expect -c " - spawn ${mvn_command} + spawn ${command} set timeout 600 expect \"${server_started_message}\" "'sleep 10 diff --git a/travis.sh b/travis.sh index d9487993774..a97ba058289 100755 --- a/travis.sh +++ b/travis.sh @@ -19,6 +19,9 @@ set -x set -o pipefail shopt -s globstar +add_ppa 'ppa:cwchien/gradle' +sudo apt-get -qqy install gradle-3.0 + SKIP_TESTS=false if [ -z "$GOOGLE_APPLICATION_CREDENTIALS" ] ; then SKIP_TESTS=true @@ -37,6 +40,15 @@ for testdir in "${devserver_tests[@]}" ; do ./java-repo-tools/scripts/test-localhost.sh appengine "${testdir}" done +newplugin_std_tests=( +# appengine/helloworld-new-plugins +) +for testdir in "${newplugin_std_tests[@]}" ; do + ./java-repo-tools/scripts/test-localhost.sh standard_mvn "${testdir}" + ./java-repo-tools/scripts/test-localhost.sh standard_gradle "${testdir}" +done + + # Check that all shell scripts in this repo (including this one) pass the # Shell Check linter. shellcheck ./**/*.sh From 9b6ff19e19a633fe2cd25b7bafe4ba591fdea894 Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Wed, 31 Aug 2016 13:41:41 -0700 Subject: [PATCH 2/3] tiny bit more --- java-repo-tools/scripts/test-localhost.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/java-repo-tools/scripts/test-localhost.sh b/java-repo-tools/scripts/test-localhost.sh index 7d8af713c04..90fc87b39f6 100755 --- a/java-repo-tools/scripts/test-localhost.sh +++ b/java-repo-tools/scripts/test-localhost.sh @@ -56,14 +56,12 @@ case $1 in server_started_message="localhost:8080" ;; gradle) - task="appengineRun" server_started_message="localhost:8080" - command="gradle clean ${mvn_goal}" + command="gradle appengineRun " ;; gradle_jetty) - task="jettyRun" server_started_message="localhost:8080" - command="gradle clean ${task} " + command="gradle jettyRun " ;; *) print_usage From 9ca46d7d9951193f7a845da127849db28e642654 Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Wed, 31 Aug 2016 14:01:30 -0700 Subject: [PATCH 3/3] Can't do substitution before the param is set - merge things --- java-repo-tools/scripts/test-localhost.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/java-repo-tools/scripts/test-localhost.sh b/java-repo-tools/scripts/test-localhost.sh index 90fc87b39f6..a83f3e20d29 100755 --- a/java-repo-tools/scripts/test-localhost.sh +++ b/java-repo-tools/scripts/test-localhost.sh @@ -27,8 +27,8 @@ print_usage () { echo " appengine - GAE Standard - Local - GA Plugin" >&2 echo " jetty - Flex - Local" >&2 echo " spring-boot - local" >&2 - echo " new_mvn - local - Standard/Flex" >&2 - echo " gradle - local - Standard" >&2 + echo " new_mvn - local - Standard / FlexCompat" >&2 + echo " gradle - local - Standard / FlexCompat" >&2 echo " gradle_jetty - local - Flex" &2 } @@ -37,31 +37,30 @@ if [[ -z "$1" ]]; then print_usage exit 1 fi -command="mvn --batch-mode clean ${mvn_goal} -DskipTests" case $1 in appengine) - mvn_goal="appengine:devserver" server_started_message="localhost:8080" + command="mvn --batch-mode clean appengine:devserver -DskipTests" ;; jetty) - mvn_goal="jetty:run-exploded" server_started_message="Started Jetty Server" + command="mvn --batch-mode clean jetty:run-exploded -DskipTests" ;; spring-boot) - mvn_goal="spring-boot:run" server_started_message="Tomcat started on port(s): 8080 (http)" + command="mvn --batch-mode clean spring-boot:run -DskipTests" ;; new_mvn) - mvn_goal="appengine:run" server_started_message="localhost:8080" + command="mvn --batch-mode clean appengine:run -DskipTests" ;; gradle) server_started_message="localhost:8080" - command="gradle appengineRun " + command="gradle appengineRun" ;; gradle_jetty) server_started_message="localhost:8080" - command="gradle jettyRun " + command="gradle jettyRun" ;; *) print_usage