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
Hi Jarno,
You can add the below to your pipeline step:
caches:
- docker
Ref: https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.