Fix clone: use GitHub token for auth + DNS retry
This commit is contained in:
parent
813a0d7379
commit
3a875c70a7
1 changed files with 4 additions and 5 deletions
|
|
@ -5,13 +5,12 @@ when:
|
||||||
clone:
|
clone:
|
||||||
git:
|
git:
|
||||||
image: alpine
|
image: alpine
|
||||||
|
environment:
|
||||||
|
GITHUB_TOKEN:
|
||||||
|
from_secret: github-token
|
||||||
commands:
|
commands:
|
||||||
- "apk update && apk add git"
|
- "apk update && apk add git"
|
||||||
- "printf 'machine %s
|
- 'for i in 1 2 3 4 5; do git clone https://x-access-token:${GITHUB_TOKEN}@github.com/${CI_REPO} . && break || echo "Clone attempt $i failed, retrying in 10s..." && rm -rf .git && sleep 10; done'
|
||||||
login %s
|
|
||||||
password %s
|
|
||||||
' \"$CI_NETRC_MACHINE\" \"$CI_NETRC_USERNAME\" \"$CI_NETRC_PASSWORD\" > ~/.netrc && chmod 600 ~/.netrc"
|
|
||||||
- 'for i in 1 2 3 4 5; do git clone "$CI_REPO_CLONE_URL" . && break || echo "Clone attempt $i failed, retrying in 10s..." && rm -rf .git && sleep 10; done'
|
|
||||||
- "git checkout $CI_COMMIT_SHA"
|
- "git checkout $CI_COMMIT_SHA"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue