Here we will discus on how to manage web development code and deploy to web server.
/web server dev & \ ----> [git repo] ------->[web server staging] \local git workdir/ | +----------->[web server prod]
Base on above diagram, there is 4 server involve:
- dev – web server for development & local git work directory. Each programmer have their own development server, maybe running in virtual machine on their laptop.
- stag – web server for staging before being push to production web server. This server will be tested by our test team and then also by client. Client will approve the changes to be push to production server. We have full control of our dev and stag server, so we can ssh to the servers.
- prod – production web server. This server may not have connection ssh, usually only ftp transfer allow.
- gitrepo – bare git repository. This git repo server will act as centralize git repo, where each developer/programmer will push their commit to the server.
- Programmer will do coding on their own development server with local git workdir (dev). Do commit, etc.
- Then do pull and push their staging branch to staging branch at staging server.
- ….staging branch centralize git repo (gitrepo) via ssh connection.
- … prod branch to prod branch in gitrepo via ssh.
- gitrepo will do ftp to prod server.