2

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?

Attempts

  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
030
  • 5,901
  • 13
  • 68
  • 110

2 Answers2

5

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:

stages:
  - prep
  - run

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

run_script:
  stage: run
  script:
    - 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.

jaxxstorm
  • 606
  • 6
  • 10
0

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

Diego Roccia
  • 348
  • 1
  • 6