Keep your Test Environment more stable with Pre-Branch
In most of company, keeping test environment stable is a big problem. When test environment unstable it affect test team. It’s waste of time for them. And making test environment unstable is a fear for every developer.
When one of in your developer team sends bad code to your master branch it affects your test environment deployment if we think we have test environment and production environment with master and prod branch.
So, we have simple solution for that. Use pre-branch and create one more branch and think it like a bad code filter. So, when someone finished his task and he will merge his code our pre-branch. Think his code bad code that guy forgot to run all tests or something like that. It will only affect your pre-branch. Btw, If we want to give a name for it, we can call preMaster branch. So, tests will fail in preMaster branch and his code won’t merge to master branch. If all test is success in preMaster branch. It will merge automatically master branch. So, deployment will be in master branch and bad code will not affect our test environment and it gives us more stable test environment.
Jenkins has a good plugin to create this pipeline. Here is link for it