I have a local git repo which I am working inside of and am trying to figure out a good workflow for deploying my local development to my production VPS server.
My Goal:
I would love to be able to work on my local git repo and simple do a git push production master
which would sync my production VPS server with my latest changes, then add a git hook to execute a bash script to do all the necessary deployment on the remote server automatically without me having to intervene outside of running the above git command.
So far I have looked into using bitbucket and their webhooks service, however I believe I would then need to set up a listener server on my VPS to receive these webhook notifications and then handle them accordingly.
I thought: "why have this middle step of using bitbucket and having to add more work in setting up my server to work with this workflow?" Couldn't I just push direct to my VPS in someway and cutout the need for bitbucket webhook.
Questions:
How can I setup this architecture on my VPS? What steps are needed to create a connection between my local git repo and the remote server - with the end goal of being able to do a simple git push production master
?
Is this a well thought out approach or am I overlooking any potensial issues here?
Additional Info:
- Linux server/dev environment
- Will be using ansible to provision the server
Any help or pointers are welcome, Thank you