Any way to cache `apt-get install -y zip` in bitbucket-pipelines?

john_mccabe August 10, 2017

Hello Atlassian Community,

I have a quick question about caching resources in bitbucket-pipelines.

We're able to cache our pip based resources just fine (thanks btw!) but now we're looking to cache the resources gathered with `apt-get install` as well.

Does anyone know if this is possible? Specifically, we would like to cache `apt-get install -y zip`

Or, if caching `apt-get install`s is not possible, is there a better way to prepare a zip file during a pipeline.

Thanks,

John

3 answers

3 votes
Mark Faulkner September 1, 2017

Same question here...

 

I've added a cache for /var/cache/apt/archives, but it doesn't appear to be working.

1 vote
Chase Han
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 14, 2022

It depends on the base image I guess.

I just cached zip command in node:16 image.

Here is what I did

bash into the docker image locally and run `which zip` to find the zip location. My one is in /usr/bin/zip. Then set up "bitbucet-pipelines.yml" file

 

image: node:16
definitions:
    services:
        docker:
    caches:
        # Cache zip cli
        zip: /usr/bin
    steps:
        - step:
              name: 'install zip'
              caches:
                  - zip
              script:
                  - apt-get install -y zip
          
         - step:
              name: 'zip file'
              caches:
                  - zip
              script:
                  - zip -j file.zip file.js
0 votes
Ben Bonnet December 10, 2017

Same here; tests requires ffmpeg, they obviously get a nice speedup if a clear way to cache apt-installs was provided! hope to find out soon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events