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,293,705
Community Members
 
Community Events
165
Community Groups

How to cache ssh-run

Hello,

I can not cache ssh-run, what do I do wrong?

Thanks !


image: mcr.microsoft.com/dotnet/sdk:6.0

pipelines:
  branches:
    master:
.
.
.
      - step:
          name: Cache-testing
          caches:
           - ssh-run
          artifacts:
            download: false
          script:
            - pipe: atlassian/ssh-run:0.4.0
              variables:
                SSH_USER: "test-admin"
                SERVER: "00.00.0.00"
                MODE: "command"
                COMMAND:  '
                          echo "it should be cached now???"
                          '
definitions:
  caches:
    ssh-run: ssh-run/

2 answers

1 accepted

1 vote
Answer accepted

Hi @serhatakbak and welcome to the community!

You can define a cache for the Docker image of the pipe atlassian/ssh-run. In order to do this, you need to define a docker service for the step and also caches: docker.

I have modified your step below to show how it should be defined:

- step:
name: Cache-testing
services:
- docker
caches:
- docker
artifacts:
download: false
script:
- pipe: atlassian/ssh-run:0.4.0
variables:
SSH_USER: 'test-admin'
SERVER: '00.00.0.00'
MODE: 'command'
COMMAND: 'some command?'

The cache will be saved after the first successful build and will be used in any subsequent builds up until a week. Any cache which is older than 1 week will be cleared automatically and repopulated during the next successful build.

Please feel free to let me know if this works for you and if you have any questions.

Kind regards,
Theodora

Thank you Theodora!

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

Kind regards,
Theodora

Like serhatakbak likes this

Hello again,

How can I do the same caching for atlassian default-image ?

Best!

Hi @serhatakbak,

Are you using atlassian/default-image as a build container for your steps?

If so, we are caching public Docker images, including atlassian/default-image, so a cache is used when a public Docker image is used as a build container. No configuration needs to be made by end-users for that purpose.

Kind regards,
Theodora

Thanks for the fast and useful answers

Best!

You are very welcome!

Have a good weekend,
Theodora

Like serhatakbak likes this
0 votes
Deleted user May 30, 2022

If I correctly understand `caches` then I think they are only useable when the image can have dependencies not being included in the current files, as with nodejs (npm install) and dotnet (dotnet restore).

So ssh-run is dependency free therefore no caches.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,111 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you