Set up automated retry (#1714)
Summary: Circle occasionally fails with a network error in one of the Android dependencies. This uses a simple retry to alleviate the need to manually restart the tasks. Pull Request resolved: https://github.com/facebook/flipper/pull/1714 Test Plan: Ran this on my private fork: https://app.circleci.com/pipelines/github/passy/flipper-1/9/workflows/e1b40086-1dce-49eb-a178-81052145ed0f Reviewed By: nikoant Differential Revision: D25170790 Pulled By: passy fbshipit-source-id: 220759fb227855eac807d64f41c78f5781599515
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ac475d315c
commit
b5e613141e
@@ -14,20 +14,28 @@ jobs:
|
|||||||
executor: default-executor
|
executor: default-executor
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: install retry
|
||||||
|
command: scripts/install-retry.sh
|
||||||
- run:
|
- run:
|
||||||
name: build and deploy
|
name: build and deploy
|
||||||
command: |
|
command: |
|
||||||
yes | sdkmanager "platforms;android-27" || true
|
yes | sdkmanager "platforms;android-27" || true
|
||||||
./gradlew :android:assembleRelease && scripts/publish-android-snapshot.sh
|
/tmp/retry -m 3 ./gradlew :android:assembleRelease
|
||||||
|
/tmp/retry -m 3 scripts/publish-android-snapshot.sh
|
||||||
release:
|
release:
|
||||||
executor: default-executor
|
executor: default-executor
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: install retry
|
||||||
|
command: scripts/install-retry.sh
|
||||||
- run:
|
- run:
|
||||||
name: build and deploy
|
name: build and deploy
|
||||||
command: |
|
command: |
|
||||||
yes | sdkmanager "platforms;android-27" || true
|
yes | sdkmanager "platforms;android-27" || true
|
||||||
./gradlew :android:assembleRelease && scripts/publish-android-release.sh
|
/tmp/retry -m 3 ./gradlew :android:assembleRelease
|
||||||
|
/tmp/retry -m 3 scripts/publish-android-release.sh
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
|
|||||||
16
scripts/install-retry.sh
Executable file
16
scripts/install-retry.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash -xe
|
||||||
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the MIT license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
|
# try to install with wget
|
||||||
|
command -v wget &>/dev/null && wget -O /tmp/retry "https://github.com/moul/retry/releases/download/v0.5.0/retry_$(uname -s)_$(uname -m)" || true
|
||||||
|
|
||||||
|
# try to install with curl
|
||||||
|
if [ ! -f /tmp/retry ]; then
|
||||||
|
command -v curl &>/dev/null && curl -L -o /tmp/retry "https://github.com/moul/retry/releases/download/v0.5.0/retry_$(uname -s)_$(uname -m)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod +x /tmp/retry
|
||||||
|
/tmp/retry --version
|
||||||
Reference in New Issue
Block a user