Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is the pipeline's cache global?

Attoumane Ahamadi May 9, 2019

Hi, 

I read the doc about caching https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html but I can't find the information I need. 

Is the default cache global or do we need to specify a cache in each step?

I would like to avoid something like this:

pipelines:
default:
- step:
name: Build phase
caches:
- maven
script:
- mvn -B clean compile

- step:
name: Test phase
caches:
- maven
script:
- mvn -B clean verify

Thanks a lot

1 answer

1 accepted

0 votes
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2019

Hello Attoumane,

The cache is global across the entirely repository. However, for it to be used you need to specify the cache in the step definition. So you will need the bitbucket-pipelines.yml configuration you have in your question. 

Note that the Maven cache only caches dependencies. So it won't carry over the compiled files from your first step into your second step. I suggest you instead combine the two steps into one.

Thanks,

Phil

Attoumane Ahamadi May 29, 2019

Thanks for these suggestions.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events