Sure - there's at least two ways to go about this with some pros and cons.

   1. *Built-in*: use "allowlists
   
<https://docs.gocd.org/current/configuration/admin_add_material.html#allow--allowlist-filters>"
   (aka "includes" in some config repo plugins
   <https://github.com/tomzo/gocd-yaml-config-plugin#git>)

   This will trigger only if the filtered paths are changed in a commit. If
   you manually trigger the plugin it will use the latest commit, regardless
   of which files were changed. Commit histories/diffs will show unrelated
   commits.

   If you rely on "fan-in" flows between pipelines/materials that use the
   same git repo and different allowlists/includes - things may not work as
   you expect.

   2. *Plugin*: use
   https://github.com/TWChennai/gocd-git-path-material-plugin (directly
   filters at a git level using git path expressions
   
<https://github.com/TWChennai/gocd-git-path-material-plugin#constructing-path-expressions>)


   If you manually trigger, will use the last commit ref that was affected
   by a commit - i.e automatic triggers and manual triggers are identical in
   semantics. Commit histories/diffs are filtered to show only commits that
   affect the given path expressions.

   Materials with different expressions are considered distinct and will
   not require/trigger fan-in, which can be a positive or a negative depending
   on your pipeline design.

   If you will have many hundreds of such pipelines, the extra load on your
   git repository server may be of concern, unless you use some kind of
   caching proxy, or use webhook triggers to avoid needing to poll.

-Chad

On Mon, Jan 23, 2023 at 1:09 PM 'Togi Kiran Kumar' via go-cd <
[email protected]> wrote:

> Hey
>
> Is there any way to Trigger stage automatically only when a specific file
> have changed
> <https://stackoverflow.com/questions/65958570/gitlab-ci-cd-trigger-pipeline-only-when-a-specific-file-have-changed>
>
>
> Thanks
>
> This message and its attachments are confidential (or legally privileged)
> information and are meant solely for the addressee of such message. Any
> unauthorized use of the message / its attachments is strictly prohibited.
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/5adda1c2-b275-4b0a-9481-9b04b4537cebn%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/5adda1c2-b275-4b0a-9481-9b04b4537cebn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAA1RwH_t_s8iLEy_2WqRG-RNdJj%3D%3DkZ%2BAY8247d6oF_EyTe_Jg%40mail.gmail.com.

Reply via email to