This documentation relates to an earlier version of Bamboo.
View

Unknown macro: {spacejump}

or visit the current documentation home.

The most important thing to remember is that the pattern has to match the whole path. We're not searching for a pattern in the filename, we're trying to match the whole path against the pattern. Now let's get to some examples:

patterncomment
^.*/(build|mysource|mylogfile|Event2|Script|dir7|stuff).*will not match file "build/srs_build.py" because according to the pattern the "build" has to be preceded by "/"
^(build|mysource|mylogfile|Event2|Script|dir7|stuff)

will not match file "Script-Ruby/Dir1/source/test.rb" because the pattern doesn't match the whole filename 

^.*(Script|a\.bash).*

will match files:

"Script-Ruby/Dir1/source/test.rb"
"a.bash"

as well as:

"TotallyDifferentDirectory/Dir1/Obsolete_Script.rb.bak"
"bambawamba.bash.exe"

^.*/(Script|a\.bash).*

will match file:

"Programs/Script/source/test.rb"
as it is in the subdirectory and the path relative to workspace root will contain "/" before filename

but will not match file:

"a.bash"
as it is located in the root of workspace 

^/(Script-Ruby|a\.bash).*will not match "Script-Ruby/Dir1/source/test.rb" as it doesn't start with "/".

Hopefully it sheds some light onto this area of Bamboo. If you have a questions regarding the constructing of regular expressions for your needs you may want to ask that question on answers.atlassian.com

  • ラベルなし

4 Comments

  1. PiotrA

    Note when using SVN repository the Bamboo will match the full filename, even the part not explicitly set in the repositoryUrl field.

    i.e. if your repository structure looks like:

    • trunk
    • trunk/projA
    • trunk/projA/someFile.txt
    • trunk/projB
    • trunk/projB/uninterestingFile.txt
    • trunk/projC
    • trunk/projC/anotherUninterestingFile.txt

    And you set up a Bamboo Plan to use repositoryUrl "http://mysvn.company.com/trunk", then to exclude "uninteresting" files from projB and projC you still need to supply the "/trunk/" prefix in the regexp, like this one

    • excludePattern = /trunk/(projB|projC).* 

    instead of - more intuitive - this one

    • excludePattern = (projB|projC).* 

     

  2. Anonymous

     

    how about supporting variable expansion in include/excludes?

     

    Is it currently possible to do?

    1. PiotrA

      I think variable expansion in include/exclude files is not currently supported (but I think it could be - do you care to raise a BAM feature request on jira.atlassian.com?)

  3. Charles Scott

    ok will do. thanks.