Development process, deployment, github

I am trying to hide the development process for our team.

We have 3/4 developer developers who work on our code base at any time.

We started using GIT, and the idea is that part of the work is more than a live fix, then they develop the main branch.

Each of them has its own development environment on the server, and we have one intermediate environment, which should always be a copy of the master branch.

Developers develop on their local ones, and then merge back into the main branch, which then has to push its changes to the intermediate server ( I want to configure something like this ).

If everything is approved, the changes should be copied in real time. I want to somehow automate this, I don’t know how. We use GitHub, so I'm sure there are automated deployment scripts out there.

We only have 1 live server, although it would be nice if only the modified files on the main branch could be deployed on a real server.

Any ideas how to do this?

Does this approach sound?

Any other comments / warnings?

Is load balancing required to do such things?

+4
source share
1 answer

My company is next to this blog .

We create a master branch for production. My business for web development .

Step:

The developer develops his function / error from the master

git checkout -b feature/featureA git checkout -b bug/B 

Thus, we will get the new code already in the released line. In the intermediate server, we use the testing branch. Therefore, when any function wants to pass the test, it will merge with this branch

In the staging server we use

 git checkout testing git pull 

There is a release branch that handles a hot fix; each hot fix will merge with this branch before merging for master. The idea is that the release branch wraps some commits before merging to handle this, if a problem occurs, just use a command like

 git reset --hard HEAD^ 

for temporary.

See my full work step

 git checkout master # Go to Master git checkout -b feature/New # New branch 

Email comes from boss to fix critical error

 git stash git checkout master git checkout -b hotfix/a 

do things

 git commit git checkout release git merge hotfix/a git checkout master git merge release # In case that you want to pack all ready to production 

In production

 git tag -d previous git tag previous git pull 

Oops! does not work

 git checkout previous 

New latch completed

 git checkout master git pull 

Continue my work

 git checkout feature/New git stash pop #Restore workspace git commit git checkout testing # ready to mix a test git merge feature/New 

Ready to release feature

 git checkout release git merge feature/New 

This is because all objects in the test branch are ready for deployment. So, when combining all the ready-made functions into the release branch, now you can do the final test.

When everything is now in production, we do

 git checkout testing git merge master git checkout release git merge master 

Script automation

I think you can look into .git/hooks/post-commit.sample to connect some script after .git/hooks/post-commit.sample code? Anyway, I never use it.

+4
source

Source: https://habr.com/ru/post/1382531/


All Articles