web - How does deployment on remote servers work? -
i'm bit new version control , deployment environments , i've come halt in learning matter: how deployment environments work if developers can't work on same local machine , forced work on remote server?
how should flow of deployment environments set according best practices?
for example considered 3 deployment environments: development, staging , production; , 3 storage environments: local, repository server , final server.
this flow chart came have no idea if it's right or how implement it:
ps. thinking staging tests on server have restricted access through login or ip checks, in case wondering.
i can give (according experience) , straightforwarfd practice, not approach there not unique standard on how work on projects:
use distributed version control system (like git/github):
- make private/public repository handle project
local development:
- developers colne project repo , contribute it, recommended each 1 work on branch, , create new branch each new feature
- within team there 1 responsible of merging branches ready
master
branch - i suggest working on virtual machine during development:
- to isolate dev environment host machine , deal dependencies
- to have virtual machine identic remote production server
- easy reset, remove, reproduce
- ...
- i suggest using virtualbox vm provider , vagrant provisioning
- i suggest project folder
shared folder
between host machine , vm, so, write source codes on host os using editor love, , @ same time code exists , runs inside vm, in't amazingly awesome ?!
- if working
python
recommend using virtual environments (like virtualenv or anaconda) isolate , manage inner dependencies - then each developer after writing source code, can commit , push changes repository
- i suggest using project automation setup tools (fabric/fabtools python):
- making script or 1 click or commands, reproduces environment , dependencies , needed project , running, developers backend, frontend, designers... no matter knowlege nor host machine types can project running merely. suggest same thing remote servers whether manually or tools (fabric/fabtools) secript install os dependencies, project dependencies, cloning project repo virsion control, , so, need give remote servers (testing, staging , production) access repository: add ssh public keys of each server keys in version control system (or use agent forwarding with
fabric
)
- making script or 1 click or commands, reproduces environment , dependencies , needed project , running, developers backend, frontend, designers... no matter knowlege nor host machine types can project running merely. suggest same thing remote servers whether manually or tools (fabric/fabtools) secript install os dependencies, project dependencies, cloning project repo virsion control, , so, need give remote servers (testing, staging , production) access repository: add ssh public keys of each server keys in version control system (or use agent forwarding with
remote servers:
- you need @ least production server make project accessible end users
- it recommended have testing , staging servers (i suppose know purpose of each one)
deployment flow: local-repo-remote server, how works ?:
- give remote servers (testing, staging , production) access repository: add ssh public keys of each server keys in version control system (or user agent forwarding
fabric
) - the developer writes code on machine
- eventually writes tests code , runs them locally (and on testing server)
- the devloper commits , pushs code branch using remote repository
deployment:
5.1 if deploy feature branch testing or staging:
ssh
access server ,cd
project folder (cloned repo manually or autamtion script)git checkout <the branch used>
git pull origin <the branch used>
5.2 if deploy production:
- make
pull request
, after pull request gets validated manager , mergedmaster
branch ssh
access server ,cd
project folder (cloned repo manually or automation script)git checkout master
# not needed coz should on mastergit pull origin master
- i suggest write script fabric/fabtools or use tools jenkins automate deployment task. voilĂ ! deployment done !
- give remote servers (testing, staging , production) access repository: add ssh public keys of each server keys in version control system (or user agent forwarding
thi bit simplified approach, there still bunch of other recommended , best prectice tools , tasks.
Comments
Post a Comment