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

Bitbucket cloud repo automatically push codes into our local private windows machine when commit.

Naveenkumar M
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2023

We have repo in bitbucket cloud. whenever commit happens we need automatically push codes into our file location. we have multiple local windows machine. i tried the FTP method and SSH both need public IP but we need each server to get a public IP thats a long process. is there any method to create a pipeline to automatically push codes into local private windows machine. previosly i tried this code

script:
- pipe: atlassian/ftp-deploy:0.3.7
variables:
USER: $FTP_USERNAME
PASSWORD: $FTP_PASSWORD
SERVER: 172.27.140.71
REMOTE_PATH: /tmp/my-remote-directory
LOCAL_PATH: /,
EXTRA_ARGS: "--exclude=filename_to_exclude.txt --exclude=folder_to_exclude/"

its not woeking so i tried openSSH method

image: node:14

pipelines:
default:
- step:
name: Deploy to Windows Server
script:
- apt-get update && apt-get install -y openssh-client
- ssh -T $USERNAME@$HOST
cd C:\databottest
git clone git@bitbucket.org:<redacted>/<redacted>.git .
git checkout master
git pull origin master

this is also not working i added known host and open 22 port also, please suggest me best way to communicate cloud to local network.

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2023

Hello @Naveenkumar M ,

Thank you for reaching out to Atlassian Community!

When executing your pipeline using Atlassian infrastructure (cloud runners), your builds will run in a cloud environment and to access external resources, such as your windows servers, these servers will need to have a public IP address so they are reachable from the internet.

In order to access servers in your local network you have the option to use self-hosted runners, so the build will run in your own infrastructure and have access to the servers within your local network.

Another option would be to implement a script/job in each of the servers that keep pulling (git pull) the repository from bitbucket every X minutes, so you would get the latest update from the repo every time the job runs.

Hope that helps to address your questions! 

Thank you, @Naveenkumar M 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events