Make GitLab CI work with a GitHub repository with mirroring
Some customer is interested in having a full CI/CD experience using GitLab CI/CD, even if the code repository is hosted on GitHub.
GitLab CI/CD relies heavily on having the code in a local repo, and cannot be linked to external ones. One possible solution is to mirror the GitHub project on GitLab, and run pipelines from here. Status will be updated via GitHub Status APIs.
To achieve this goal, we need:
- A service integration that allows GitLab to update GitHub status via API: https://gitlab.com/gitlab-org/gitlab-ce/issues/39412
- faster and reliable mirroring of the original repo, so new commits will be taken in the shortest time possible, triggering a pipeline: https://gitlab.com/gitlab-org/gitlab-ee/issues/3745
It is also useful to make the setup operation easy for users, so they don't have to configure manually everything and have a good user experience when using a GitLab project just for CI/CD:
- Automatic mirroring and service integration setup for GitHub projects: https://gitlab.com/gitlab-org/gitlab-ce/issues/39415
- CI/CD focused UX for projects: https://gitlab.com/gitlab-org/gitlab-ce/issues/39416
There is some customer interest in making GitLab CI work with GitHub. Example flow:
- Create a repo in GitHub with a
.gitlab-ci.yml. - Set up a mirror on GitLab.
- Set up a push hook to trigger CI from GitHub -> GitLab
- GitLab updates the mirror and runs a build
- After build is complete, use the GitHub status API to update the status on GitHub
/cc: @bikebilly, @sytses
Edited by Fabio Busatto