Automatic push to production server


I want know wheather its possible to automatically push code to production server? I have my code repo in bitbucket (git) and cloned it into my localhost and my production server. Whenever I do changes, I push it from the localhost and then pull it from the production server. Production server runs on EC2 ubuntu.

1 answer

There are a couple ways of doing it. Easiest is to set up a cron job just to do a git pull every X minutes. Not really what you're asking for but it is the easiest. To do what you want - you'd need to set up a service to ping somewhere on a http accessible port. For more on bitbucket services see . Somewhere there is a list of ips that bitbucket pings from so you can filter on that. Then just have whatever is at the other end of that listening - do the git pull. Depending on your scale/usage etc - you might want to consider a CI server though.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,755 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you