At the moment we put a .gitlab-ci.yml in every project. At the moment we have more than 50 projects and every time something changes to the .gitlab-ci.yml the team has to change the structure in all of the projects. Is it possible to have one common .gitlab-ci.yml?


  1. Tried to have one gitlab-ci.yml, but do not know how to change the default path to this file
  2. common scripts decrease the amount of code duplication, but if the gitlab-ci.yml structure changes we have to implement it in all the projects

No this is not possible. It goes against the idea of why this method exists, because what if you add a git repo/project that needs a completely different yml file?

What you could do (as you mentioned) is have a script you run, which is downloaded during the .gitlab-ci.yml run process. Something like this:

  - prep
  - run

  stage: prep
    - wget http://my_local_script.lan/run_suite.sh -O /tmp/run_suite.sh

  stage: run
    - bash /tmp/run_suite.sh

Set this as the script for every project, and then all you need to do is update the run_suite.sh once and all new projects will use it.

I don't think there's any better way than that, I'm afraid.

| improve this answer | |

If I want a global CI configuration I would go with system hooks.

Of course you will lose some (meaning all) of the cool features of Gitlab CI

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.