Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

Can we cache the scp-deploy pipe

Hello,

We are using the scp-deploy pipe to upload our artifacts to one of our linux servers. In  the logs of the pipe we can always see the following snippets:

Unable to find image 'bitbucketpipelines/scp-deploy:1.2.1' locally
1.2.1: Pulling from bitbucketpipelines/scp-deploy
Status: Downloaded newer image for bitbucketpipelines/scp-deploy:1.2.1

Is there anyway we can make the image available 'locally' so it does not have to download the scp-deploy pipe every single build? if so how do I do this as its unclear to me. Same question actually for the ssh-run pipe image.

Thanks for any help.

regards,

Jarno

 

2 answers

1 accepted

0 votes
Answer accepted

Hi Jarno,

You can add the below to your pipeline step:

caches:
- docker

 Ref: https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/

What do we need to add to this section?

definitions:
caches:

No, this needs to be added to the step 

Like Jacob Willig likes this

I have the same question, I did the same procedure, but it didn't work.

For the atlassian/scp-deploy:1.2.1 and atlassian/ssh-run:0.4.1 images

Added in the caches of the first step doesn't work and if I add it in the second step it doesn't work either, always with the following error:

"It looks like docker isnt defred as a service Ín this step. You"l need to add that before you car add a dccker cache."

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

pipelines:
branches:
dev:
- step:
name: Build
caches:
- dotnetcore
script:
- dotnet restore "src/LogSistemas.Domynus.Api/LogSistemas.Domynus.Api.csproj"
- dotnet build "src/LogSistemas.Domynus.Api/LogSistemas.Domynus.Api.csproj" -c Release
- dotnet publish "src/LogSistemas.Domynus.Api/LogSistemas.Domynus.Api.csproj" -c Release -o $BITBUCKET_CLONE_DIR/app/publish
artifacts:
- app/publish/**
- step:
name: Deploy to server
deployment: test
script:
- pipe: atlassian/scp-deploy:1.2.1
name: Sending files
caches:
- docker
variables:
USER: $USER
SERVER: $SERVER
REMOTE_PATH: $REMOTE_PATH #Path that you want to copy your files to on the server and must exist prior to running the pipeline
LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/app/publish/*' #Path that has the files we need to copy over. In this case, simply put the relative path to the artifact we produced in the previous step
DEBUG: 'true'
- pipe: atlassian/ssh-run:0.4.1
name: Executing api
variables:
SSH_USER: $USER
SERVER: $SERVER
COMMAND: 'cd ~/domynus/domynus_web_backend2 && dotnet LogSistemas.Domynus.Api.dll'
DEBUG: 'true'

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events