Skip to content

Commit

Permalink
chore(java): retry staging portion of the release with backoff (#858)
Browse files Browse the repository at this point in the history
* chore(java): retry staging portion of the release with backoff

* build: skip logging the retried command - it may contain secrets
  • Loading branch information
chingor13 authored Nov 19, 2020
1 parent a073c87 commit 68742c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion synthtool/gcp/templates/java_library/.kokoro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function retry_with_backoff {

# allow a failures to continue
set +e
echo "${command}"
${command}
exit_code=$?

Expand Down
17 changes: 10 additions & 7 deletions synthtool/gcp/templates/java_library/.kokoro/release/stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 68742c6

Please sign in to comment.