Skip to content

Commit 68742c6

Browse files
authored
chore(java): retry staging portion of the release with backoff (#858)
* chore(java): retry staging portion of the release with backoff * build: skip logging the retried command - it may contain secrets
1 parent a073c87 commit 68742c6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

synthtool/gcp/templates/java_library/.kokoro/common.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function retry_with_backoff {
2525

2626
# allow a failures to continue
2727
set +e
28-
echo "${command}"
2928
${command}
3029
exit_code=$?
3130

synthtool/gcp/templates/java_library/.kokoro/release/stage.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@ python3 -m pip install gcp-releasetool
2020
python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script
2121

2222
source $(dirname "$0")/common.sh
23+
source $(dirname "$0")/../common.sh
2324
MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml
2425
pushd $(dirname "$0")/../../
2526

2627
setup_environment_secrets
2728
create_settings_xml_file "settings.xml"
2829

29-
mvn clean install deploy -B \
30-
--settings ${MAVEN_SETTINGS_FILE} \
31-
-DskipTests=true \
32-
-DperformRelease=true \
33-
-Dgpg.executable=gpg \
34-
-Dgpg.passphrase=${GPG_PASSPHRASE} \
35-
-Dgpg.homedir=${GPG_HOMEDIR}
30+
# attempt to stage 3 times with exponential backoff (starting with 10 seconds)
31+
retry_with_backoff 3 10 \
32+
mvn clean install deploy -B \
33+
--settings ${MAVEN_SETTINGS_FILE} \
34+
-DskipTests=true \
35+
-DperformRelease=true \
36+
-Dgpg.executable=gpg \
37+
-Dgpg.passphrase=${GPG_PASSPHRASE} \
38+
-Dgpg.homedir=${GPG_HOMEDIR}
3639

3740
if [[ -n "${AUTORELEASE_PR}" ]]
3841
then

0 commit comments

Comments
 (0)