This repository was archived by the owner on Dec 3, 2023. It is now read-only.
File tree 6 files changed +91
-25
lines changed
6 files changed +91
-25
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
20
20
# # cd to the parent directory, i.e. the root of the git repo
21
21
cd ${scriptDir} /..
22
22
23
+ # include common functions
24
+ source ${scriptDir} /common.sh
25
+
23
26
# Print out Java version
24
27
java -version
25
28
echo ${JOB_TYPE}
26
29
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
34
39
35
40
# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
36
41
if [[ ! -z " ${GOOGLE_APPLICATION_CREDENTIALS} " && " ${GOOGLE_APPLICATION_CREDENTIALS} " != /* ]]; then
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change 15
15
16
16
set -eo pipefail
17
17
18
- cd github/java-core/
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
19
25
20
26
# Print out Java
21
27
java -version
@@ -24,8 +30,9 @@ echo $JOB_TYPE
24
30
export MAVEN_OPTS=" -Xmx1024m -XX:MaxPermSize=128m"
25
31
26
32
# 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
30
37
31
38
mvn -B dependency:analyze -DfailOnWarning=true
Original file line number Diff line number Diff line change @@ -17,18 +17,26 @@ set -eo pipefail
17
17
# Display commands being run.
18
18
set -x
19
19
20
- cd github/java-core/
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
21
27
22
28
# Print out Java version
23
29
java -version
24
30
echo ${JOB_TYPE}
25
31
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
32
40
33
41
# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
34
42
JAR=linkage-monitor-latest-all-deps.jar
Original file line number Diff line number Diff line change 56
56
},
57
57
{
58
58
"packagePatterns" : [
59
- " ^com.google.cloud:libraries-bom"
59
+ " ^com.google.cloud:google-cloud-core" ,
60
+ " ^com.google.cloud:libraries-bom" ,
61
+ " ^com.google.cloud.samples:shared-configuration"
60
62
],
61
63
"semanticCommitType" : " chore" ,
62
64
"semanticCommitScope" : " deps"
75
77
}
76
78
],
77
79
"semanticCommits" : true
78
- }
80
+ }
Original file line number Diff line number Diff line change 1
1
{
2
- "updateTime": "2020-03-17T19:21:17.805286Z ",
2
+ "updateTime": "2020-03-25T23:35:19.763220Z ",
3
3
"sources": [
4
4
{
5
- "template ": {
6
- "name": "java_library ",
7
- "origin ": "synthtool.gcp ",
8
- "version ": "2020.2.4 "
5
+ "git ": {
6
+ "name": "synthtool ",
7
+ "remote ": "https://github.com/googleapis/ synthtool.git ",
8
+ "sha ": "e36822bfa0acb355502dab391b8ef9c4f30208d8 "
9
9
}
10
10
}
11
11
]
You can’t perform that action at this time.
0 commit comments