Forums

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

Is there any way you can create separate dependency caches between different branches ?

Decebal Dobrica
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 6, 2018

I started using pipeline caches which is brilliant when my branches are similar, in particular a docker cache where the docker layer's building blocks are the same.

 

I am looking for something like an alias, maybe something like this :

```

caches:

    - docker: 'staging.docker.tar'

```

Or something a little bit more automated that takes into account the branch name when creating the cache.

 

1 answer

0 votes
Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2018

Hi @Decebal Dobrica

you might want to take a look a custom pages: https://confluence.atlassian.com/bitbucket/caching-dependencies-895552876.html (see the 'Custom caches for other build tools and directories' section). 

This allows you to define custom caches. You could then combine this with different pipelines for specific branches that use your custom caches. 

So this could look something like this:

pipelines:
branches:
some-branch:
- step:
caches:
- my-custom-cache1
...
other-branch:
- step:
caches:
- my-custom-cache2

definitions: caches: my-custom-cache1: custom/cache/1
my-custom-cache2: custom/cache/2
Decebal Dobrica
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 20, 2018

Hi @Jeroen De Raedt,

Thanks for you reply.

I was aware of custom caches, but not sure exactly how I could use them with docker.

Could you help me understand how I can create a custom cache using a pre-defined cache like docker.

Unlike other dependency caches such as `node_modules` for nodejs as example, docker cache should work quite differently, in the sense that the cache is built from layers by attlasian as I found it described here: https://confluence.atlassian.com/bitbucket/run-docker-commands-in-bitbucket-pipelines-879254331.html#RunDockercommandsinBitbucketPipelines-ci_caching.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events