Skip to content

Commit e13f3b6

Browse files
committed
Allow Travis to continue build if decryption fails.
Decryption of the service key can fail if Travis is building from a fork instead of a branch.
1 parent 89e9e51 commit e13f3b6

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.travis.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,24 @@
1515
language: java
1616
jdk:
1717
- oraclejdk8
18-
env:
19-
- GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/service-account.json GCLOUD_PROJECT=cloud-samples-tests
2018
before_install:
2119
- openssl aes-256-cbc -K $encrypted_37a4f399de75_key -iv $encrypted_37a4f399de75_iv -in service-account.json.enc -out service-account.json -d
22-
23-
script: mvn --batch-mode clean verify -DskipTests=false | egrep -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
20+
&& export GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/service-account.json GCLOUD_PROJECT=cloud-samples-tests
21+
|| true
22+
# Skip the install step, since Maven will download the dependencies we need
23+
# when the test build runs.
24+
# http://stackoverflow.com/q/31945809/101923
25+
# https://docs.travis-ci.com/user/customizing-the-build/#Skipping-the-Installation-Step
26+
install: true
27+
script:
28+
- (
29+
set -o pipefail
30+
SKIP_TESTS=false
31+
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS"]; then
32+
SKIP_TESTS=true
33+
fi
34+
mvn --batch-mode clean verify -DskipTests=$SKIP_TESTS | egrep -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
35+
)
2436
after_success:
2537
- mvn clean cobertura:cobertura coveralls:report
2638
branches:

0 commit comments

Comments
 (0)