Gitlab CI - How to call assembly only if changes occur on a specific set of files

In Gitlab CI, how do you run a build only if changes occur in a specific set of files?

Is there a way to include or exclude certain files when starting the assembly? For example: updating the README.md, .gitignore files should not cause assembly.

+6
source share
2 answers

It is currently not possible to somehow initiate a build in GitLab CI based on which files have been edited.

I had thought of this feature before, and I think it can be very useful for several different use cases.

The closest problem I could find for this is https://gitlab.com/gitlab-org/gitlab-ce/issues/23010

In any case, to answer your question:

You cannot do it right now - even manually - because there is no way to determine if the merge request has changed the file or not, since CI has no concept of a merge request.

Pipelines β€œunderstand” that merger requests should be added soon.

+2
source

No, this is not possible - not now!

I think this is the problem you are looking for: https://gitlab.com/gitlab-org/gitlab-ce/issues/19232 - This is a very high rating (more than 100 hits) up).

This milestone changed for the next 3-6 months, 4 months ago. ( https://gitlab.com/gitlab-org/gitlab-ce/issues/19232#note_31943850 ) I hope we will see this feature soon.

0
source

Source: https://habr.com/ru/post/1012512/


All Articles