Below is my pipeline script
I think the issue is bitbucket cloud can't reach my internal server, please confirm.
image: mcr.microsoft.com/dotnet/core/sdk:3.1
pipelines:
default:
- step:
name: Build App
caches:
- dotnetcore
script:
- dotnet restore
- dotnet build --no-restore
- dotnet publish --no-restore -c Release -o $BITBUCKET_CLONE_DIR/release
artifacts:
- release/**
- step:
name: Deploy to server
deployment: staging
script:
- pipe: atlassian/scp-deploy:0.3.9
variables:
USER: $USER
SERVER: '10.89.1.115'
REMOTE_PATH: '/d/sites/sfh'
LOCAL_PATH: 'release/*'
DEBUG: 'true'
Hi @Mo Suqi and welcome to the community!
The issue is that a private IP is used in the scp-deploy pipe.
Pipelines that run in our own infrastructure don't have access to your local network.
The pipe needs the public IP of a server so that it can reach the server and deploy to it.
Kind regards,
Theodora
Hi @Mo Suqi,
We haven't tested the pipe with deployment to a private IP in a local network using a runner, but we have customers who have set this up successfully:
You can try this with a Linux Docker runner, as it's the only type of runner that supports pipes.
The other types of runners, Linux Shell, macOS, and Windows, don't support pipes. If you would like to use any of these types of runners, you can use an scp commnand to deploy instead of the pipe.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mo Suqi,
A pipe is a tool you can use in your bitbucket-pipelines.yml file to perform a certain action.
I am copying from our documentation:
A pipe uses a script that lives in a Docker container and has the commands you previously put in your yaml along with a few extras.
For example, in the bitbucket-pipelines.yml file you shared in your post, you are using the atlassian/scp-deploy pipe in a step with the following definition:
- pipe: atlassian/scp-deploy:0.3.9
variables:
USER: $USER
SERVER: '10.89.1.115'
REMOTE_PATH: '/d/sites/sfh'
LOCAL_PATH: 'release/*'
DEBUG: 'true'
This pipe will deploy to a remote server using scp.
We have a list of pipes that can be used in your bitbucket-pipelines.yml file. Some of them are developed by Atlassian, while others are developed by different companies (you can scroll down to see the list of pipes and then select one to see more details):
Each pipe allows you to perform certain actions by configuring only the necessary variables in your bitbucket-pipelines.yml file.
If you want to deploy with scp, you can use the atlassian/scp-deploy in your yml file, but you could also use an scp command instead (if you make use of a Linux Shell, MacOS, or Windows self-hosted runner).
I hope this helps, please feel free to let me know if you have any other questions.
Kind regards,
Theodora
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.