Commit 2f70e775 authored by Rohit's avatar Rohit
Browse files

updates-from-upstream: Use ssh for cloning project repos

* Cloning large repos (such as proprietary_vendor_*) repos, leads to HTTP 504 timeouts
* This could be worked around by using ssh to clone, but gitlab doesnt have an option for us to clone via ssh
* Fine then, we'll do it ourselves.

NB: Code responsible for `GIT_STRATEGY: clone` can be found [here](https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/shells/abstract.go#L317)

Test: update-from-upstream runs fine for proprietary_vendor_xiaomi repo
parent d1222d2a
# uses
# SSH_E_ROBOT_PRIVATE_KEY defined in e group
# SSH_E_ROBOT_PRIVATE_KEY defined in e group
# SSH_KNOWN_HOSTS defined in e group
variables:
......@@ -11,7 +11,7 @@ variables:
rules:
- if: '$CI_PIPELINE_SOURCE =~ /schedule/ && $CI_COMMIT_REF_NAME == $LOCAL_BRANCH'
variables:
GIT_STRATEGY: clone
GIT_STRATEGY: none
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
......@@ -23,8 +23,11 @@ variables:
- chmod 644 ~/.ssh/known_hosts
- git config --global user.email $GITLAB_USER_EMAIL
- git config --global user.name "$GITLAB_USER_NAME"
- cd $CI_BUILD_DIR
- rm -rf $CI_PROJECT_DIR
- git clone $CI_PROJECT_SSH_URL $CI_PROJECT_DIR
- cd $CI_PROJECT_DIR
script:
- git remote set-url origin $CI_PROJECT_SSH_URL
- git fetch origin
- git checkout $CI_COMMIT_REF_NAME
- git merge origin/$UPSTREAM_BRANCH
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment