Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Commit f0f7e6c

Browse files
chore: update common templates (#35)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/01397865-3755-4aac-90a2-8834d828363b/targets
1 parent c559658 commit f0f7e6c

File tree

6 files changed

+92
-25
lines changed

6 files changed

+92
-25
lines changed

.kokoro/build.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
2020
## cd to the parent directory, i.e. the root of the git repo
2121
cd ${scriptDir}/..
2222

23+
# include common functions
24+
source ${scriptDir}/common.sh
25+
2326
# Print out Java version
2427
java -version
2528
echo ${JOB_TYPE}
2629

27-
mvn install -B -V \
28-
-DskipTests=true \
29-
-Dclirr.skip=true \
30-
-Denforcer.skip=true \
31-
-Dmaven.javadoc.skip=true \
32-
-Dgcloud.download.skip=true \
33-
-T 1C
30+
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
31+
retry_with_backoff 3 10 \
32+
mvn install -B -V \
33+
-DskipTests=true \
34+
-Dclirr.skip=true \
35+
-Denforcer.skip=true \
36+
-Dmaven.javadoc.skip=true \
37+
-Dgcloud.download.skip=true \
38+
-T 1C
3439

3540
# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
3641
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then

.kokoro/common.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC
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+
# set -eo pipefail
17+
18+
function retry_with_backoff {
19+
attempts_left=$1
20+
sleep_seconds=$2
21+
shift 2
22+
command=$@
23+
24+
echo "${command}"
25+
${command}
26+
exit_code=$?
27+
28+
if [[ $exit_code == 0 ]]
29+
then
30+
return 0
31+
fi
32+
33+
# failure
34+
if [[ ${attempts_left} > 0 ]]
35+
then
36+
echo "failure (${exit_code}), sleeping ${sleep_seconds}..."
37+
sleep ${sleep_seconds}
38+
new_attempts=$((${attempts_left} - 1))
39+
new_sleep=$((${sleep_seconds} * 2))
40+
retry_with_backoff ${new_attempts} ${new_sleep} ${command}
41+
fi
42+
43+
return $exit_code
44+
}

.kokoro/dependencies.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
set -eo pipefail
1717

18-
cd github/java-document-ai/
18+
## Get the directory of the build script
19+
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
20+
## cd to the parent directory, i.e. the root of the git repo
21+
cd ${scriptDir}/..
22+
23+
# include common functions
24+
source ${scriptDir}/common.sh
1925

2026
# Print out Java
2127
java -version
@@ -24,8 +30,9 @@ echo $JOB_TYPE
2430
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"
2531

2632
# this should run maven enforcer
27-
mvn install -B -V \
28-
-DskipTests=true \
29-
-Dclirr.skip=true
33+
retry_with_backoff 3 10 \
34+
mvn install -B -V \
35+
-DskipTests=true \
36+
-Dclirr.skip=true
3037

3138
mvn -B dependency:analyze -DfailOnWarning=true

.kokoro/linkage-monitor.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,26 @@ set -eo pipefail
1717
# Display commands being run.
1818
set -x
1919

20-
cd github/java-document-ai/
20+
## Get the directory of the build script
21+
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
22+
## cd to the parent directory, i.e. the root of the git repo
23+
cd ${scriptDir}/..
24+
25+
# include common functions
26+
source ${scriptDir}/common.sh
2127

2228
# Print out Java version
2329
java -version
2430
echo ${JOB_TYPE}
2531

26-
mvn install -B -V \
27-
-DskipTests=true \
28-
-Dclirr.skip=true \
29-
-Denforcer.skip=true \
30-
-Dmaven.javadoc.skip=true \
31-
-Dgcloud.download.skip=true
32+
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
33+
retry_with_backoff 3 10 \
34+
mvn install -B -V \
35+
-DskipTests=true \
36+
-Dclirr.skip=true \
37+
-Denforcer.skip=true \
38+
-Dmaven.javadoc.skip=true \
39+
-Dgcloud.download.skip=true
3240

3341
# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
3442
JAR=linkage-monitor-latest-all-deps.jar

renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
},
5757
{
5858
"packagePatterns": [
59+
"^com.google.cloud:google-cloud-document-ai",
5960
"^com.google.cloud:libraries-bom"
6061
],
6162
"semanticCommitType": "chore",
@@ -75,4 +76,4 @@
7576
}
7677
],
7778
"semanticCommits": true
78-
}
79+
}

synth.metadata

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
{
2-
"updateTime": "2020-03-24T09:02:29.572218Z",
2+
"updateTime": "2020-03-25T09:50:37.415220Z",
33
"sources": [
44
{
55
"git": {
66
"name": "googleapis",
77
"remote": "https://github.com/googleapis/googleapis.git",
8-
"sha": "275fbcce2c900278d487c33293a3c7e1fbcd3a34",
9-
"internalRef": "301661567"
8+
"sha": "551cf1e6e3addcc63740427c4f9b40dedd3dac27",
9+
"internalRef": "302792195"
1010
}
1111
},
1212
{
1313
"git": {
1414
"name": "googleapis",
1515
"remote": "https://github.com/googleapis/googleapis.git",
16-
"sha": "275fbcce2c900278d487c33293a3c7e1fbcd3a34",
17-
"internalRef": "301661567"
16+
"sha": "551cf1e6e3addcc63740427c4f9b40dedd3dac27",
17+
"internalRef": "302792195",
18+
"log": "551cf1e6e3addcc63740427c4f9b40dedd3dac27\nfeat: Add OS Config AgentEndpointService v1 PatchJobs and Tasks APIs.\n\nPiperOrigin-RevId: 302792195\n\n1df117114c73299b614dfd3ba3632bf246669336\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 302753982\n\n71d6c56a14bb433beb1237dccb48dabcd9597924\nRefresh monitoring client libraries.\nRename to Cloud Monitoring API.\nAdded support for TimeSeriesQueryLanguageCondition condition type in alert policies.\n\nPiperOrigin-RevId: 302735422\n\n25a1781c096974df99d556cc5888fefa82bc6425\nbazel: migrate all go_gapic_library targets to microgenerator implementation\n\n* update rules_go and gazelle bazel dependencies\n* update gapic-generator bazel dependency (with build file generator changes)\n\nPiperOrigin-RevId: 302730217\n\n36c0febd0fa7267ab66d14408eec2afd1b6bec4e\nUpdate GAPIC configurations to v2 .yaml.\n\nPiperOrigin-RevId: 302639621\n\n078f222366ed344509a48f2f084944ef61476613\nFix containeranalysis v1beta1 assembly target name\n\nPiperOrigin-RevId: 302529186\n\n0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n"
1819
}
1920
},
2021
{
2122
"git": {
2223
"name": "synthtool",
2324
"remote": "https://github.com/googleapis/synthtool.git",
24-
"sha": "bcad3e01b69851ad682a87f8202003a1683ad73a"
25+
"sha": "ee4330a0e5f4b93978e8683fbda8e6d4148326b7",
26+
"log": "ee4330a0e5f4b93978e8683fbda8e6d4148326b7\nchore(java_templates): mark version bumps of current library as a chore (#452)\n\nWith the samples/install-without-bom/pom.xml referencing the latest released library, we want to mark updates of this version as a chore for renovate bot.\na0d3133a5d45544a66345059eebf76933265c099\nfix(java): run mvn install with retry (#453)\n\n* fix(java): run mvn install with retry\n\n* fix invocation of command\n6a17abc7652e2fe563e1288c6e8c23fc260dda97\ndocs: document the release schedule we follow (#454)\n\n\n7e98e1609c91082f4eeb63b530c6468aefd18cfd\nbuild: use checkout@v2, not v1, as this allows manual re-running of tests (#451)\n\nhttps://github.com/actions/checkout/issues/23\n"
2527
}
2628
}
2729
],

0 commit comments

Comments
 (0)