I have some doubts about using git to deploy test environment and production environment. I hope the seniors can point out a clear path.
I have read many articles before and some people also use this method.
Don’t know which of these two methods is better? I'm a little stuck on this right now.
I don’t know which method is more scientific and efficient?
In addition, if you use the first method, you should be able to push the code to bitbucket. If the development branch on bitbucket changes, the test environment will automatically synchronize the development branch on bitbucket. If the main branch on bitbucket is updated, the production environment will automatically synchronize the code of the main branch on bitbucket. (You should be able to do this using git hock.) But if you do this, do you still need to establish git warehouses on the test environment and production environment servers?
高洛峰2017-05-02 09:33:57
Version management (git/svn) and deployment should be properly isolated (decoupled).
The test system and deployment system only need to know the branch & version number of the target code.
The deployment system should have the ability to deploy any version of code on any branch (the code that needs to be online is not necessarily the latest).
大家讲道理2017-05-02 09:33:57
Deploy a master branch in the production environment, checkout a branch from the master such as the develop branch in the test environment, checkout a branch such as feature from the master, and then use the develop merge feature branch for testing. After testing, use the master merge feature branch. develop merges master's code every day to keep it up to date.