bitbucket pipelines deploy to local windows server
Asked by Mo Suqi:

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'
```


Answers:
author: Theodora Boudale
body: Hi [@Mo Suqi](/t5/user/viewprofilepage/user-id/5161802) 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

comments: author: Mo Suqi
body: Thanks for the reply. What having a runner on my network solve this problem as long as the runner has a public IP?


author: Theodora Boudale
body: Hi [@Mo Suqi](/t5/user/viewprofilepage/user-id/5161802),

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:

* <https://community.atlassian.com/t5/Bitbucket-questions/scp-deploy-from-a-Self-Hosted-runner-to-Internal-Server/qaq-p/2018835>

You can try this with a [Linux Docker runner](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-runners-for-linux/), as it's the only type of runner that supports pipes.

The other types of runners, [Linux Shell](https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-linux-shell/), [macOS](https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-macos/), and [Windows](https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-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


author: Mo Suqi
body: Sorry for my lack of knowledge, but when you say pipes what do you mean?


author: Theodora Boudale
body: Hi [@Mo Suqi](/t5/user/viewprofilepage/user-id/5161802),

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](https://support.atlassian.com/bitbucket-cloud/docs/what-are-pipes/):
> 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.

<br />

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):

* <https://bitbucket.org/product/features/pipelines/integrations>

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](https://manpages.ubuntu.com/manpages/kinetic/man1/scp.1.html) 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


Tags: bitbucket-cloud

cloud