Can I exclude certain files from an artifact directory?

We have some Bamboo plans that copy directories as artifacts. The copy pattern is "**/test/output/**". Sometimes, some really large core dump files make their way into those directories. It doesn't take too many builds to start running our bamboo server out of space because we're copying all those core files.

Is there a pattern I can use to copy everything in those directories except files that start with the string "core"?

2 answers

Jamey,

You should just separate your artifacts (from the build side) into 3 parts deployments scripts, war file and properties file. Then from the deployment side, you can pick and choose which you want to package/deploy.

This would be the simplest solution. Why worry about the complexities of regex (though I'm not even sure it's possible to exclude artifacts).

Hope this helps!

Ron

That makes sense, thank you. :)

Yes, or at least I think so based on this page: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fconcept-inclusion-exclusion-patterns.htm

which says in part (after declaring it's the same as the ANT patterns):

The inclusion and exclusion elements of the implicit PatternSet can be specified inside the directory-based task (or explicit fileset) via either:

  • the attributes includes and excludes.
  • nested elements <include> and <exclude>.
  • external files specified with the attributes includesfile and excludesfile.
  • external files specified with the nested elements <includesfile> and <excludesfile>.

The syntax you may have to fiddle with but it is likely excludes=**core** or excludes=*core* or something like that. Since we don't use the xml structure in the copy patterns. May need a comma like **/test/output/**, excludes=*core* or something like that.

Do you have any more information on this? I am creating a deployment artifact which contains the deployment scripts, a .war and a properties file. I want to exclude this properties file from the artifact, because it contains properties which are specific to the build server (for example the location/credentials of our test database instance). The properties file will be overwritten anyway when the deployment is run against a different environment, but it would be nice to have a clean artifact to be completely sure. :)

[EDIT] To be specific I have tried:

  • deployment/**/*, excludes=*.properties
  • deployment/**/* excludes=*.properties
  • deployment/**/*, excludes:*.properties
  • deployment/**/* excludes:*.properties
  • deployment/**/*, exclude=*.properties
  • deployment/**/* exclude=*.properties
  • deployment/**/*, exclude:*.properties
  • deployment/**/*, exclude:*.properties

But all to no avail, I just get: "Unable to publish artifact [DeploymentBuildArtifact]". :(

did you find a way?

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,493 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you