I'm a bit new to version control and deployment environments and I've come to a halt in my learning about the matter: how do deployment environments work if developers can't work on the same local machine and are forced to always work on a remote server?
How should the flow of the deployment environments be set up according to best practices?
For this example I considered three deployment environments: development, staging and production; and three storage environments: local, repository server and final server.
This is the flow chart I came up with but I have no idea if it's right or how to properly implement it:
PS. I was thinking the staging tests on the server could have restricted access through login or ip checks, in case you were wondering.
I can give you (according to my experience) a good and straightforwarfd practice, this is not the only approach as there is not a unique standard on how to work on all projects:
Use a distributed version control system (like git/github):
local Development:
master
branchshared folder
between your host machine and your VM, so, you will write your source codes on your host OS using the editor you love, and at the same time this code exists and runs inside your VM, is in't that amazingly awesome ?!python
I also strongly recommend using virtual environments (like virtualenv or anaconda) to isolate and manage inner dependenciesfabric
)Remote servers:
Deployment flow: Local-Repo-Remote server, how it works ?:
fabric
)Deployment:
5.1 If you would like to deploy a feature branch to testing or staging:
ssh
access to the server and then cd
to the project folder (cloned from repo manually or by automation script)git checkout <the branch used>
git pull origin <the branch used>
5.2 If you would like to deploy to production:
pull request
and after the pull request gets validated by the manager and merged with master
branchssh
access to the server and then cd
to the project folder (cloned from repo manually or by automation script)git checkout master
# not needed coz it should always be on the mastergit pull origin master
This is a bit simplified approach, there are still a bunch of other recommended and best practice tools and tasks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With