How do predefined caches work on pipelines?

I see there are predefined caches in pipelines now...that's great.  We are using maven, so I'll use that as an example here.

I am, however, unclear on how they work. I could see it one of two ways. 

  1. The predefined maven cache comes pre-populated with some well-known subset of maven central and is shared among all users, and is not updated by the build process at all.
    • pro: shared caching.
    • con: depends on Atlassian to update that cache with new versions as they are released by the community. This was often a pain point for us on Bamboo Cloud with the predefined images (but more wrt tools like java or mvn itself in that case).
    • requires additional cache defined for our own artifacts, which we can define as 
      maven-corporate: ~/.m2/repository/our/corporate/package
  2. It is just a predefined definition, and the cache is actually populated on every repo's build so it include everything that we put into that maven local repository, including stuff from maven central, but also stuff we get from our own corporate repository.
    • pro: everything cached in one place.
    • con: population of the cache for common maven dependencies/plugins is still downloaded from our own corporate artifact repository.
    • con: potential privacy/security concern that our corporate artifacts are cached. (more information on this issue is appreciated in the docs at well).

I've been trying to configure it assuming option #1 above, but it does not seem to work properly -- or at least the reported cache size is very small (eg <900 B), so I don't think it is working based on that.

It would be nice if the documentation of Pipelines Caching were updated with more details, about this issue and all around.

1 answer

1 accepted

Hi Ben,

Thanks for your question.

Pre-defined caches work like you described as 2. They are just a convenient mapping of commonly cached directories so that users won't need to define them. Indeed they'll cache the entire m2 repository.

Caches are private to the repo. Could you describe your security requirements a little further?

Re: caches being <900B, looks like we have an issue where for some Docker images, caches are saved empty. The dev team are looking into.

Thanks for the feedback, I'll update our documentation to clarify this.

Thanks for the response.

Our security concerns are just born out of this line the docs:

  • Sensitive data such as passwords and credentials – cache contents are available to commands in the steps of pipelines.

To me, this implies that there is a security risk with the caching, but perhaps no more so than any other part of our source code and artifacts being available to pipelines, so I'm sure it's fine.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

635 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot