Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,191
Community Members
 
Community Events
176
Community Groups

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

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

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 Dec 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

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

Atlassian Community Events