It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do predefined caches work on pipelines?

Ben Tatham Jun 07, 2017

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

1 vote
Answer accepted
Joshua Tjhin Atlassian Team Jun 12, 2017 • edited

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.

Ben Tatham Jun 12, 2017

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 Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,330 views 3 22
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you