Remote/project includes with local gitlab-runner

Hello!

My .gitlab-ci.yml uses includes like:

include:
  - project: 'ORG/DEPARTMENT/ci'
    file: pipeline.yml
    ref: master

I’d like to run some stages on my local runner first without pushing to gitlab, however, the local gitlab-runner can’t figure out a way to associate project with an actual git project, I tried to add https:// to the project name with my gitlab domain name, but this is not working, is there a way to do this?

Thanks in advance

Welcome @elacheche !

I’m not sure that I’ve understood your question. Each .gitlab-ci.yml file is associated with the Git repo in which it lives. When you run a pipeline, the gitlab-runner will automatically clone your repo, and run the .gitlab-ci.yml file from the root of the cloned repo.

I suspect you just need to add a stage to your .gitlab-ci.yml file that is earlier than all the other stages, but maybe I have misunderstood?

Cheers,

Sarah

@snim2 Thanks for your reply, I think my question was not clear.

What I shared was just and example, my real .gitlab-ci.yml have the stages and it works perfectly on Gitlab.

My issue is that I can use any .gitlab-ci.yml that have includes from my dev workstation gitlab-runner.

For example using gitlab-runner exec docker syntax.

Thanks in advance

Ah, you just want to run the CI jobs locally?

I suspect that exec isn’t really a full replica of what happens in the pipeline, and I think it might be deprecated now.

I’m aware of gitlab-ci-local which aims to help with this, but I haven’t used it myself.

1 Like

Interesting! Gona try it, thanks a lot! :slight_smile:

1 Like