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

Can we cache the scp-deploy pipe

Jarno Dijkstra March 10, 2022

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
Ankit Gupta March 10, 2022

Hi Jarno,

You can add the below to your pipeline step:

caches:
- docker

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

Jacob Willig March 12, 2022

What do we need to add to this section?

definitions:
caches:
Ankit Gupta March 12, 2022

No, this needs to be added to the step 

Like Jacob Willig likes this
0 votes
Fernando Cristan December 20, 2022

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