Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run pipeline only on changes in one dir

So I've got a project with some structure. And whenever I push changes to any file pipeline is run. But I want it to run only when there are changes in particular directory. Is it even possible?

like image 665
hasrthur Avatar asked Apr 04 '18 13:04

hasrthur


2 Answers

The JIRA issue that refers to this situation was recently updated with the following solution that can be straightforward applied.

Example from bitbucket blog post:

- step:
          name: build-frontend-artifact
          condition:
              changesets:
                  includePaths:
                    # only xml files directly under resources directory
                    - "src/main/resources/*.xml"
                    # any changes in frontend directory
                    - "src/site/**"
          script:
             - echo "Building frontend artifact"
like image 152
manasouza Avatar answered Oct 28 '22 23:10

manasouza


This may help you:

Determine If Any File Changed In Directory For Latest Git Commit

that way if there are no changes in your directory you could finish the build early.

like image 39
Laures Avatar answered Oct 29 '22 00:10

Laures