Skip to content

Commit c1e0dfc

Browse files
author
Jerjou Cheng
committed
Add jenkins scripts & test for sparkjava
1 parent a60498c commit c1e0dfc

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

flexible/sparkjava/jenkins.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 Google Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Fail on non-zero return and print command to stdout
18+
set -xe
19+
20+
# Jenkins Test Script
21+
function runtests () {
22+
curl -X GET \
23+
"https://${2}-dot-${1}.appspot.com/api/users" | \
24+
grep "^\\["
25+
}
26+
27+
# Jenkins provides values for GOOGLE_PROJECT_ID and GOOGLE_VERSION_ID
28+
29+
# Test with Maven
30+
mvn clean appengine:deploy \
31+
-Dapp.deploy.version="${GOOGLE_VERSION_ID}"
32+
33+
# End-2-End tests
34+
runtests "${GOOGLE_PROJECT_ID}" "${GOOGLE_VERSION_ID}"

jenkins.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -xe
4+
5+
# Find all jenkins.sh's and run them.
6+
find . -mindepth 2 -maxdepth 5 -name jenkins.sh -type f | while read path; do
7+
(
8+
pushd "${path%jenkins.sh}"
9+
/bin/bash ./jenkins.sh
10+
)
11+
done

0 commit comments

Comments
 (0)