-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (42 loc) · 1.95 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
sudo: false
language: java
jdk:
- oraclejdk8
cache:
directories:
- $HOME/.m2
os: linux
install:
# download Cloud SDK
- wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-112.0.0-linux-x86_64.tar.gz
- tar -xzvf google-cloud-sdk-112.0.0-linux-x86_64.tar.gz
- export PATH=$PWD/google-cloud-sdk/bin:$PATH
# add App Eengine component to Cloud SDK
- gcloud components install app-engine-java --quiet
# update all Cloud SDK components
- gcloud components update --quiet
# decrypt the tavis-app-maven-plugin Cloud SDK project service account key
- openssl aes-256-cbc -K $encrypted_2eaf8826df7c_key -iv $encrypted_2eaf8826df7c_iv -in travis-app-maven-plugin-65d709ff8c4e.json.enc -out travis-app-maven-plugin-65d709ff8c4e.json -d
- gcloud auth activate-service-account --key-file travis-app-maven-plugin-65d709ff8c4e.json
- gcloud config set project travis-app-maven-plugin
script:
# download test app
- git clone https://github.com/loosebazooka/simple-spring-boot-appengine-app.git
- cd simple-spring-boot-appengine-app
# clear Maven cache of com.google.cloud.* dependencies
- rm -rf $HOME/.m2/repository/com/google/cloud
# verify app not deployed
- curl -I https://springboot-dot-travis-app-maven-plugin.appspot.com/ | grep '^HTTP.*404 Not Found'
# deploy using the plugin
- mvn clean appengine:deploy
# verify app deployed
- curl -I https://springboot-dot-travis-app-maven-plugin.appspot.com/ | grep '^HTTP.*200 OK'
# cleanup by deleting the whole service
- gcloud preview app services delete springboot --quiet
- cd ..
- git clone https://github.com/loosebazooka/simple-appengine-app.git
- cd simple-appengine-app
- curl -I https://whatever-dot-travis-app-maven-plugin.appspot.com/ | grep '^HTTP.*404 Not Found'
- mvn clean appengine:deploy
- curl -I https://whatever-dot-travis-app-maven-plugin.appspot.com/ | grep '^HTTP.*200 OK'
- gcloud preview app services delete whatever --quiet