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

bitbucket pipelines deploy to local windows server

Mo Suqi March 3, 2023

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'

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2023

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

Mo Suqi March 6, 2023

Thanks for the reply.  What having a runner on my network solve this problem as long as the runner has a public IP?

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 8, 2023

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

Mo Suqi March 8, 2023

Sorry for my lack of knowledge, but when you say pipes what do you mean?

Like vincent schol likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 8, 2023

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

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events