From 493394de5164b29731735edaf524edb7b1801f28 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 18 Nov 2020 15:06:08 -0800 Subject: [PATCH 1/2] chore(java): retry staging portion of the release with backoff --- .../java_library/.kokoro/release/stage.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/synthtool/gcp/templates/java_library/.kokoro/release/stage.sh b/synthtool/gcp/templates/java_library/.kokoro/release/stage.sh index 3c482cbc5..16126d2eb 100755 --- a/synthtool/gcp/templates/java_library/.kokoro/release/stage.sh +++ b/synthtool/gcp/templates/java_library/.kokoro/release/stage.sh @@ -20,19 +20,22 @@ python3 -m pip install gcp-releasetool python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script source $(dirname "$0")/common.sh +source $(dirname "$0")/../common.sh MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml pushd $(dirname "$0")/../../ setup_environment_secrets create_settings_xml_file "settings.xml" -mvn clean install deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DskipTests=true \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} if [[ -n "${AUTORELEASE_PR}" ]] then From 5c6dcf52eb13e08094362afe79aa00e8bca8ebf1 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 19 Nov 2020 10:37:31 -0800 Subject: [PATCH 2/2] build: skip logging the retried command - it may contain secrets --- synthtool/gcp/templates/java_library/.kokoro/common.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/synthtool/gcp/templates/java_library/.kokoro/common.sh b/synthtool/gcp/templates/java_library/.kokoro/common.sh index a8d0ea04d..ace89f45a 100644 --- a/synthtool/gcp/templates/java_library/.kokoro/common.sh +++ b/synthtool/gcp/templates/java_library/.kokoro/common.sh @@ -25,7 +25,6 @@ function retry_with_backoff { # allow a failures to continue set +e - echo "${command}" ${command} exit_code=$?