Skip to content

Commit 0369b1c

Browse files
chore: update common templates (#989)
1 parent 61fdcd4 commit 0369b1c

File tree

7 files changed

+84
-21
lines changed

7 files changed

+84
-21
lines changed

.kokoro/build.sh

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,23 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI
3737
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS})
3838
fi
3939

40+
RETURN_CODE=0
41+
set +e
42+
4043
case ${JOB_TYPE} in
4144
test)
4245
mvn test -B -Dclirr.skip=true -Denforcer.skip=true
43-
bash ${KOKORO_GFILE_DIR}/codecov.sh
44-
bash .kokoro/coerce_logs.sh
46+
RETURN_CODE=$?
4547
;;
4648
lint)
4749
mvn \
4850
-Penable-samples \
4951
com.coveo:fmt-maven-plugin:check
52+
RETURN_CODE=$?
5053
;;
5154
javadoc)
5255
mvn javadoc:javadoc javadoc:test-javadoc
56+
RETURN_CODE=$?
5357
;;
5458
integration)
5559
mvn -B ${INTEGRATION_TEST_ARGS} \
@@ -59,21 +63,46 @@ integration)
5963
-Denforcer.skip=true \
6064
-fae \
6165
verify
62-
bash .kokoro/coerce_logs.sh
66+
RETURN_CODE=$?
6367
;;
6468
samples)
65-
mvn -B \
66-
-Penable-samples \
67-
-DtrimStackTrace=false \
68-
-Dclirr.skip=true \
69-
-Denforcer.skip=true \
70-
-fae \
71-
verify
72-
bash .kokoro/coerce_logs.sh
69+
if [[ -f samples/pom.xml ]]
70+
then
71+
pushd samples
72+
mvn -B \
73+
-Penable-samples \
74+
-DtrimStackTrace=false \
75+
-Dclirr.skip=true \
76+
-Denforcer.skip=true \
77+
-fae \
78+
verify
79+
RETURN_CODE=$?
80+
popd
81+
else
82+
echo "no sample pom.xml found - skipping sample tests"
83+
fi
7384
;;
7485
clirr)
7586
mvn -B -Denforcer.skip=true clirr:check
87+
RETURN_CODE=$?
7688
;;
7789
*)
7890
;;
7991
esac
92+
93+
if [ "${REPORT_COVERAGE}" == "true" ]
94+
then
95+
bash ${KOKORO_GFILE_DIR}/codecov.sh
96+
fi
97+
98+
# fix output location of logs
99+
bash .kokoro/coerce_logs.sh
100+
101+
if [[ "${ENABLE_BUILD_COP}" == "true" ]]
102+
then
103+
chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop
104+
${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/google-http-java-client
105+
fi
106+
107+
echo "exiting with ${RETURN_CODE}"
108+
exit ${RETURN_CODE}

.kokoro/continuous/java8.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ env_vars: {
55
key: "TRAMPOLINE_IMAGE"
66
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
77
}
8+
9+
env_vars: {
10+
key: "REPORT_COVERAGE"
11+
value: "true"
12+
}

.kokoro/nightly/integration.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,17 @@ env_vars: {
55
key: "TRAMPOLINE_IMAGE"
66
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
77
}
8+
9+
env_vars: {
10+
key: "ENABLE_BUILD_COP"
11+
value: "true"
12+
}
13+
14+
before_action {
15+
fetch_keystore {
16+
keystore_resource {
17+
keystore_config_id: 73713
18+
keyname: "java_it_service_account"
19+
}
20+
}
21+
}

.kokoro/nightly/java8.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ env_vars: {
55
key: "TRAMPOLINE_IMAGE"
66
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
77
}
8+
9+
env_vars: {
10+
key: "REPORT_COVERAGE"
11+
value: "true"
12+
}

.kokoro/nightly/samples.cfg

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22

33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
5-
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
77
}
88

99
env_vars: {
10-
key: "JOB_TYPE"
11-
value: "samples"
10+
key: "JOB_TYPE"
11+
value: "samples"
1212
}
1313

1414
env_vars: {
15-
key: "GCLOUD_PROJECT"
16-
value: "gcloud-devel"
15+
key: "GCLOUD_PROJECT"
16+
value: "gcloud-devel"
1717
}
1818

1919
env_vars: {
20-
key: "GOOGLE_APPLICATION_CREDENTIALS"
21-
value: "keystore/73713_java_it_service_account"
20+
key: "GOOGLE_APPLICATION_CREDENTIALS"
21+
value: "keystore/73713_java_it_service_account"
22+
}
23+
24+
env_vars: {
25+
key: "ENABLE_BUILD_COP"
26+
value: "true"
2227
}
2328

2429
before_action {

.kokoro/presubmit/java8.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ env_vars: {
55
key: "TRAMPOLINE_IMAGE"
66
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
77
}
8+
9+
env_vars: {
10+
key: "REPORT_COVERAGE"
11+
value: "true"
12+
}

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"updateTime": "2020-02-01T08:32:15.578940Z",
2+
"updateTime": "2020-03-02T22:34:09.877226Z",
33
"sources": [
44
{
55
"template": {
66
"name": "java_library",
77
"origin": "synthtool.gcp",
8-
"version": "2019.10.17"
8+
"version": "2020.2.4"
99
}
1010
}
1111
]

0 commit comments

Comments
 (0)