Fix clone: add netrc auth + cleanup between retries
This commit is contained in:
parent
32b38c432b
commit
8747db4aaf
1 changed files with 5 additions and 1 deletions
|
|
@ -7,7 +7,11 @@ clone:
|
||||||
image: alpine
|
image: alpine
|
||||||
commands:
|
commands:
|
||||||
- "apk update && apk add git"
|
- "apk update && apk add git"
|
||||||
- "for i in 1 2 3 4 5; do git clone https://github.com/immovika/realestate-crawler.git . && break || echo \"Clone attempt $i failed, retrying in 10s...\" && sleep 10; done"
|
- "printf 'machine %s
|
||||||
|
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