GitLabCiMultipleRepositories

4th July 2017 at 3:03pm
CI/CD GitLab

https://gitlab.com/gitlab-org/gitlab-ce/issues/4194

  1. Using git submodule, see https://docs.gitlab.com/ce/ci/git_submodules.html.
  2. Re-using $CI_REPOSITORY_URL defined by GitLab and available even inside child Docker containers. This environment variable already contains username and password, that can be used for another repository on the same server. See snippet from .gitlab-ci.yml:
rm -Rf --one-file-system "thirdparty/repo"
git clone \
  "${CI_REPOSITORY_URL%$CI_PROJECT_PATH.git}thirdparty/repo.git" \
  "thirdparty/repo"