Skip to content

Commit 83658a5

Browse files
author
Frank Natividad
committed
fixing endpoints-migration sample in java8
1 parent 41e8b92 commit 83658a5

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

appengine-java8/endpoints-v2-migration/jenkins.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function TestEndpoints () {
2323
curl -X GET \
2424
"https://${2}-dot-${1}.appspot.com/_ah/api/helloworld/v1/hellogreeting/0" | \
2525
tee "$ERROR_OUTPUT_DIR/response.json" | \
26-
grep "hello version-${2}"
26+
grep "hello ${3} version-${2}"
2727

2828
# Test getGreeting Endpoint (goodbye world!)
2929
curl -X GET \
@@ -48,30 +48,36 @@ function TestEndpoints () {
4848

4949
# Jenkins provides values for GOOGLE_PROJECT_ID and GOOGLE_VERSION_ID
5050
# Update Greetings.java
51-
sed -i'.bak' -e "s/hello world!/hello version-${GOOGLE_VERSION_ID}!/g" src/main/java/com/example/helloendpoints/Greetings.java
51+
UNIQUE_MAVEN_STRING="maven"
52+
sed -i'.bak' \
53+
-e "s/hello world!/hello ${UNIQUE_MAVEN_STRING} version-${GOOGLE_VERSION_ID}!/g" \
54+
src/main/java/com/example/helloendpoints/Greetings.java
5255

5356
# Test with Maven
5457
mvn clean appengine:deploy \
5558
-Dapp.deploy.version="${GOOGLE_VERSION_ID}" \
5659
-Dapp.deploy.promote=false
5760

5861
# End-2-End tests
59-
TestEndpoints "${GOOGLE_PROJECT_ID}" "${GOOGLE_VERSION_ID}"
62+
TestEndpoints "${GOOGLE_PROJECT_ID}" "${GOOGLE_VERSION_ID}" "${UNIQUE_MAVEN_STRING}"
6063

6164
# Clean
6265
mvn clean
6366

6467
# Test with Gradle
6568
# Modify Greetings.java for Gradle
66-
sed -i'.bak' -e "s/hello version-${GOOGLE_VERSION_ID}!/hello version-${GOOGLE_VERSION_ID}!/g" src/main/java/com/example/helloendpoints/Greetings.java
69+
UNIQUE_GRADLE_STRING="gradle"
70+
sed -i'.bak' \
71+
-e "s/hello ${UNIQUE_MAVEN_STRING} version-${GOOGLE_VERSION_ID}!/hello ${UNIQUE_GRADLE_STRING} version-${GOOGLE_VERSION_ID}!/g" \
72+
src/main/java/com/example/helloendpoints/Greetings.java
6773

6874
# Deploy Gradle
6975
gradle -Pappengine.deploy.promote=false \
7076
-Pappengine.deploy.version="${GOOGLE_VERSION_ID}" \
7177
appengineDeploy
7278

7379
# End-2-End tests
74-
TestEndpoints "${GOOGLE_PROJECT_ID}" "${GOOGLE_VERSION_ID}"
80+
TestEndpoints "${GOOGLE_PROJECT_ID}" "${GOOGLE_VERSION_ID}" "${UNIQUE_GRADLE_STRING}"
7581

7682
# Clean
7783
gradle clean

appengine-java8/endpoints-v2-migration/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ limitations under the License.
2626
<artifactId>appengine-java8-samples</artifactId>
2727
<groupId>com.google.cloud</groupId>
2828
<version>1.0.0</version>
29-
<relativePath>../..</relativePath>
29+
<relativePath>..</relativePath>
3030
</parent>
3131

3232
<properties>

0 commit comments

Comments
 (0)