Using Gitlab CI for mirrored projects

Hi,

I would like to use Gitlab CI for a project mirrored from GitHub. I have to mirror it, I can’t ask everyone to push to both repositories or to follow any other work-around so I can’t add the .gitlab-ci.yml file to this mirrored project (and it would be nice to avoid placing .gitlab-ci.yml in the GitHub repo) otherwise it became diverged from upstream.

I read there are some ideas going on how to solve this but those are still far from being in production.

As a work-around, I tried to have a different project - where I could place .gitlab-ci.yml - and use webhooks + triggers to run the build but I couldn’t make this idea work either because weebhooks are missing some functionality (e.g. knowing which branch or tag has been pushed) and I have to use private docker registry (see this issue with triggers).

I wonder if there are any other (good) ways to try to make this work or could this be impossible with all these constraints for the moment?

Thank you very much for your help!

Hello,

I think you may have an additional branch in your gitlab clone, name it e.g. “build-on-gitlab”. Define a job with the restriction that it is executed only when triggered. Trigger the branch via cron and do a git rebase origin/master firstly. At least the project will be built, however you loose the coupling between origin/master and your job.

Hi Mirko,

Thank you for your answer.
I tried something similar with triggers but as I explained above I couldn’t make it fully working because of the authentication issue to private image repositories from triggered jobs.