Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions java-repo-tools/scripts/test-localhost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 / FlexCompat" >&2
echo " gradle - local - Standard / FlexCompat" >&2
echo " gradle_jetty - local - Flex" &2
}

if [[ -z "$1" ]]; then
Expand All @@ -36,16 +39,28 @@ if [[ -z "$1" ]]; then
fi
case $1 in
appengine)
mvn_plugin="appengine:devserver"
server_started_message="localhost:8080"
command="mvn --batch-mode clean appengine:devserver -DskipTests"
;;
jetty)
mvn_plugin="jetty:run-exploded"
server_started_message="Started Jetty Server"
command="mvn --batch-mode clean jetty:run-exploded -DskipTests"
;;
spring-boot)
mvn_plugin="spring-boot:run"
server_started_message="Tomcat started on port(s): 8080 (http)"
command="mvn --batch-mode clean spring-boot:run -DskipTests"
;;
new_mvn)
server_started_message="localhost:8080"
command="mvn --batch-mode clean appengine:run -DskipTests"
;;
gradle)
server_started_message="localhost:8080"
command="gradle appengineRun"
;;
gradle_jetty)
server_started_message="localhost:8080"
command="gradle jettyRun"
;;
*)
print_usage
Expand All @@ -60,11 +75,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
Expand All @@ -78,7 +92,7 @@ set -x
(
cd "$code_path"
expect -c "
spawn ${mvn_command}
spawn ${command}
set timeout 600
expect \"${server_started_message}\"
"'sleep 10
Expand Down
12 changes: 12 additions & 0 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis might not like this. Probably have to add this stuff to the .travis.yml instead https://docs.travis-ci.com/user/installing-dependencies/#Installing-Packages-with-the-APT-Addon (or change to VM-based builder with sudo: required in .travis.yml https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments.


SKIP_TESTS=false
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS" ] ; then
SKIP_TESTS=true
Expand All @@ -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