Forums

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

atlassian/bitbucket-upload-file pipe setup takes too long

sandesh
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!
July 11, 2024

This is a step in my pipeline:

 

- step:
name: 'Upload APK to Downloads folder'
script:
- pipe: atlassian/bitbucket-upload-file:0.7.2
variables:
BITBUCKET_ACCESS_TOKEN: $BITBUCKET_ACCESS_TOKEN
FILENAME: "app/build/outputs/apk/release/*.apk"

 

The build step for this step takes much longer than I would expect, mainly because it has to pull atlassian/bitbucket-upload-file:0.7.2 each time. I am wondering whether this can be cached or if there are any other ways to speed up this process.

This is the image that I am using: 

image: mingc/android-build-box:1.28.0

 

1 answer

2 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2024

Hi @sandesh and welcome to the community!

A pipe starts a new Docker container and yes, it is possible to cache the pipe's Docker image. You just need to adjust the definition of your step as follows:

- step:
name: 'Upload APK to Downloads folder'
script:
- pipe: atlassian/bitbucket-upload-file:0.7.2
variables:
BITBUCKET_ACCESS_TOKEN: $BITBUCKET_ACCESS_TOKEN
FILENAME: "app/build/outputs/apk/release/*.apk"
services:
- docker
caches:
- docker

Please note that this will work only if you're not using the pre-defined Docker cache elsewhere in your yml. If you are building a Docker image in a different step of your yml and you want to use cache for that as well, you will need to adjust the cache definition for that different step.

An example of that is the following (feel free to ignore this example if you are not building a Docker image in a different step that you want to cache):

- step:
name: Build Docker image
script:
- docker load -i docker-cache/* || echo "No cache"
- docker build .
- mkdir -p docker-cache && docker save $(docker images -aq) -o docker-cache/cache.tar
- docker image ls -aq
caches:
- my-docker-cache
services:
- docker

And you would need a definitions section in your yml file as follows (this is using a smart cache, that gets updated when you change the Dockerfile):

definitions:
caches:
my-docker-cache:
key:
files:
- Dockerfile
path: docker-cache

Please feel free to reach out if you have any questions!

Kind regards,
Theodora

sandesh
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!
July 15, 2024

Thank you for help @Theodora Boudale ! This helped speed up the pipeline

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2024

You are very welcome, @sandesh! Please feel free to reach out if you ever need anything else!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events