1+ #! /bin/bash
2+ # Copyright 2020 Google Inc.
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ # `-e` enables the script to automatically fail when a command fails
17+ # `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
18+ set -eo pipefail
19+
20+ echo " ********** MAVEN INFO ***********"
21+ mvn -v
22+
23+ # Get the directory of the build script
24+ scriptDir=$( realpath $( dirname " ${BASH_SOURCE[0]} " ) )
25+ # # cd to the parent directory, i.e. the root of the git repo
26+ cd ${scriptDir} /..
27+
28+ # include common functions
29+ source ${scriptDir} /common.sh
30+
31+ # Attempt to install 3 times with exponential backoff (starting with 10 seconds)
32+ retry_with_backoff 3 10 \
33+ mvn install -B -V \
34+ -DskipTests=true \
35+ -Dclirr.skip=true \
36+ -Denforcer.skip=true \
37+ -Dmaven.javadoc.skip=true \
38+ -Dgcloud.download.skip=true \
39+ -T 1C
40+
41+ # Activate service account
42+ gcloud auth activate-service-account \
43+ --key-file=" $GOOGLE_APPLICATION_CREDENTIALS " \
44+ --project=" $GOOGLE_CLOUD_PROJECT "
45+
46+ # Move into the samples directory
47+ cd samples/
48+
49+ echo -e " \n******************** RUNNING SAMPLE TESTS ********************"
50+
51+ mvn --fail-at-end clean verify
0 commit comments