Search code examples
gitgitlabgitlab-cipipeline

Can I use symbolic link to .gitlab-ci.yml?


Now my project looks like this

/ProjectRoot
  - .gitlab-ci.yml (symbolic link to "shared/.gitlab-ci.yml")
  - shared (this is submodule)
    - .gitlab-ci.yml

In this situation, pipeline fails because of "yaml invalid". When I open ".gitlab-ci.yml" file at gitlab, the content of that file is "shared/.gitlab-ci.yml"

Is there any solution that I can use symbolic link to ".gitlab-ci.yml" and link it to the file in submodule ?

I wanna use same ".gitlab-ci.yml" file in multiple projects.

Thanks.

In pileline editor, the content of ".gitlab-ci.yml" file is "shared/.gitlab-ci.yml"


Solution

  • Is there any solution that I can use symbolic link to ".gitlab-ci.yml" and link it to the file in submodule ?

    No.

    I wanna use same ".gitlab-ci.yml" file in multiple projects.

    So include: one .gitlab-ci in another, see for example https://about.gitlab.com/blog/2023/01/03/keeping-your-development-dry/ .

    You would use https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject .