Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Build Condition: Exclude Folder, but Include Subfolder of That Folder #4263

fabb ·

I have a monorepo which has roughly that structure:

  • package.json (and other files in the root)
  • /scripts
  • /common
  • /applications/app1/...
  • /applications/app2/...
  • /applications/...

I only want the build to run when something is changed in the root files, /scripts, /common or /applications/app1. Since new applications could be added and I want to avoid to have to update this build config again, I do not want to explicitly exclude all other applications like -applications/app2/**,--applications/app3/**,etc.. I rather want to exclude the whole /applications folder except the /applications/app1 folder.

I tried writing it like this: -applications/**,+applications/search/** (similarly to .gitignore or .dockerignore files where this would work), but that seems not to work in QuickBuild, the build just does not get triggered.

Any ideas how I could achieve that? Is it possible at all with Include/Exclude Path Patterns? Or maybe rather with a custom groovy script?

  • replies 5
  • views 2009
  • stars 0
robinshen ADMIN ·

Please write more specific path first, like below:

+applications/search/**,-applications/**, +**
fabb ·
robinshen ADMIN ·

QB matches each pattern in turn to determine if the path should be included or excluded. If last pattern "+**" does not exist, changing path for instance "package.json" has no matching pattern and will be considered not satisfying the build condition.

Will add this example to documentation.

fabb ·

QB matches each pattern in turn to determine if the path should be included or excluded.

That was my mental model too, but it doesn't make any sense when there is +** in the end, as that would include applications/** again too, no?

robinshen ADMIN ·

For instance:

  1. When file "applications/app1/somefile" is changed, QB will match it in turn to find that it matches with "-applications/**" first, since this pattern is prefixed with "-", QB will return false to indicate that the file does not match the whole patterns.
  2. When file "applications/package.json" is changed, only the last pattern will be matched, QB will return true to indicate that the file match the whole patterns
  3. If multiple files are changed, QB will match each changed file against the patterns, and return true as long as one file matches.