Fix clone: add netrc auth + cleanup between retries

This commit is contained in:
Viktor Barzin 2026-02-22 22:28:49 +00:00
parent 8747db4aaf
commit 813a0d7379

View file

@ -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: