diff options
author | Jeremy Bettis <jbettis@google.com> | 2022-09-20 15:12:01 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-21 15:46:34 +0000 |
commit | 08a849acaa4d614b3ed7250295c5d912e27b7d89 (patch) | |
tree | b6821229b42a3e75d5551e58b3730045e14956ea | |
parent | b86ad198a30644becc7b099447234bca5ce91fc9 (diff) | |
download | chrome-ec-08a849acaa4d614b3ed7250295c5d912e27b7d89.tar.gz |
gitlab: Fix git clone retries
The retries weren't actually working because $? was getting set by the
echo call.
BRANCH=None
BUG=b:244590155
TEST=Ran sh commands manually
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: I3b8a7133e260f052df00950a139aee4613fa102c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3908158
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Commit-Queue: Al Semjonovs <asemjonovs@google.com>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r-- | .gitlab-ci.yml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4449a20e4..b7025dc99b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,9 +50,10 @@ before_script: while [ ${retries} -gt 0 ] ; do rm -rf "${path}" ; mkdir -p "${path}" ; - git clone --depth 1 -b "${branch}" "${url}" "${path}" || echo "git clone failed will retry ${retries} times"; - if [ $? -eq 0 ]; then + if git clone --depth 1 -b "${branch}" "${url}" "${path}"; then break ; + else + echo "git clone failed will retry ${retries} times"; fi ; retries="$(( ${retries} - 1 ))" ; done ; |