Chore: Add retry option to curl (#90179)

add retry option to curl
This commit is contained in:
Serge Zaitsev 2024-07-08 15:47:31 +02:00 committed by GitHub
parent c42dd6e920
commit e9876749d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -194,7 +194,7 @@ steps:
name: betterer-frontend name: betterer-frontend
- commands: - commands:
- apk add --update curl jq bash - apk add --update curl jq bash
- is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork) | jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi - if [ "$is_fork" != false ]; then return 1; fi
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
@ -258,7 +258,7 @@ services: []
steps: steps:
- commands: - commands:
- apk add --update curl jq bash - apk add --update curl jq bash
- is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork) | jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi - if [ "$is_fork" != false ]; then return 1; fi
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
@ -346,7 +346,7 @@ services: []
steps: steps:
- commands: - commands:
- apk add --update curl jq bash - apk add --update curl jq bash
- is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork) | jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi - if [ "$is_fork" != false ]; then return 1; fi
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
@ -466,7 +466,7 @@ steps:
name: compile-build-cmd name: compile-build-cmd
- commands: - commands:
- apk add --update curl jq bash - apk add --update curl jq bash
- is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork) | jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi - if [ "$is_fork" != false ]; then return 1; fi
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
@ -966,7 +966,7 @@ services:
steps: steps:
- commands: - commands:
- apk add --update curl jq bash - apk add --update curl jq bash
- is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork) | jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi - if [ "$is_fork" != false ]; then return 1; fi
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
@ -1307,7 +1307,7 @@ services: []
steps: steps:
- commands: - commands:
- apk add --update curl jq bash - apk add --update curl jq bash
- is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork) | jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi - if [ "$is_fork" != false ]; then return 1; fi
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
@ -5181,6 +5181,6 @@ kind: secret
name: gcr_credentials name: gcr_credentials
--- ---
kind: signature kind: signature
hmac: e296b5401c0632dc2549a2c3d0594a58c459f5d185376e9f1728ce75c1d8ff3c hmac: 33b84712df805ae55115bdfedc6c40f71c75e7d6065656b49295b0f78f47bb9d
... ...

View File

@ -99,7 +99,7 @@ def clone_enterprise_step_pr(source = "${DRONE_COMMIT}", target = "main", canFai
check = [] check = []
else: else:
check = [ check = [
'is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" | jq .head.repo.fork)', 'is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" | jq .head.repo.fork)',
'if [ "$is_fork" != false ]; then return 1; fi', # Only clone if we're confident that 'fork' is 'false'. Fail if it's also empty. 'if [ "$is_fork" != false ]; then return 1; fi', # Only clone if we're confident that 'fork' is 'false'. Fail if it's also empty.
] ]