Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BitBucket - pushing code to staging & production servers

Tags:

bitbucket

I'm currently transitioning from SVN to GIT, specifically BitBucket for our repos.

I've seen a handful of articles via Google talking about how to setup githooks / BitBucket services to automatically push commits to BitBucket out to remote servers. and if I'm reading it all correctly, this is all about automatically pushing out these updates to the remote servers.

I want to be able to control the push to our remote servers, especially the production server, as we want to control when changes are made rather than assume everything committed is production ready.

Am I missing the plot and something obvious in how to make this happen? My goal would be to virtually eliminate the need to setup FTP access to the staging & production servers for other team members, but still allow code to be pushed to these in a controlled manner.

like image 698
TH1981 Avatar asked May 22 '13 16:05

TH1981


People also ask

How do you push to staging?

Under Staging Site, select the Actions menu and then select Sync Sites. Select Push staging to production. Only select Overwrite content if you want to overwrite the database as well as the files in your live production site. Select Sync.

How do I push a remote code to Bitbucket?

Enter git push at the command line to push your commits from your local repository to Bitbucket. To be specific about exactly where you're pushing, enter git push <remote_server> <branch_name>. This command specifies you're pushing to: remote_server — the name of the remote server.


1 Answers

Have a look at this post:

http://lkwdwrd.com/git-auto-deployment/

This is not your actual requirement. But with a little efforts with PHP you can make your push to be selective.

An expected solution will be store each payload in database as a queue and deploy complete queue payloads(and empty the queue) when required.

like image 178
Abhishek Sachan Avatar answered Oct 13 '22 11:10

Abhishek Sachan