From 150a2e177af8e1cd109d8986c69c9f76a3d7e8a8 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Sat, 29 Feb 2020 08:58:44 +1100 Subject: [PATCH] [Buildkite] Enable automatic retries for failed github artifact step (#658) * [Buildkite] Enable automatic retries for failed github artifact step This is to handle failures which may occur when attempting to upload assets, per: https://buildkite.com/authelia/authelia/builds/465#537f931f-efc3-4f7b-9527-c927c1425a52. * [Buildkite] Ensure GitHub artifact step is reported as a failure When the initial command fails and we remove the release, we need to ensure that the exit status is reported as non-zero to trigger the automatic retry. --- .buildkite/deployment.yml | 2 ++ .buildkite/steps/ghartifacts.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.buildkite/deployment.yml b/.buildkite/deployment.yml index 3716d6b70..355f32892 100644 --- a/.buildkite/deployment.yml +++ b/.buildkite/deployment.yml @@ -15,6 +15,8 @@ steps: - label: ":github: Deploy Artifacts" command: ".buildkite/steps/ghartifacts.sh" + retry: + automatic: true agents: upload: "fast" key: "artifacts" diff --git a/.buildkite/steps/ghartifacts.sh b/.buildkite/steps/ghartifacts.sh index cf08984f1..dcfe3c210 100755 --- a/.buildkite/steps/ghartifacts.sh +++ b/.buildkite/steps/ghartifacts.sh @@ -13,4 +13,4 @@ done echo "--- :github: Deploy artifacts for release: ${BUILDKITE_TAG}" git fetch -hub release create "${BUILDKITE_TAG}" "${artifacts[@]}" -F <(echo -e "${BUILDKITE_TAG}\n\n## Changelog\n$(git log --oneline --pretty='* %h %s' $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))...$(git describe --abbrev=0 --tags))\n\n## Docker Container\n* \`docker pull authelia/authelia:${BUILDKITE_TAG//v}\`") \ No newline at end of file +hub release create "${BUILDKITE_TAG}" "${artifacts[@]}" -F <(echo -e "${BUILDKITE_TAG}\n\n## Changelog\n$(git log --oneline --pretty='* %h %s' $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))...$(git describe --abbrev=0 --tags))\n\n## Docker Container\n* \`docker pull authelia/authelia:${BUILDKITE_TAG//v}\`") || hub release delete "${BUILDKITE_TAG}" && false