1

Due to constraints of Jenkins, we need to maintain multiple branches (with different branch names), across our repository.

- development
- main
- bvt
- unit-tests

All of these should contain the same code, but as we are using Jenkinsfile to run the various specific (tag based) tests in each branch, we need to maintain the branches with these specific names for Jenkins to pick up and run the tests.

Is there any way, where-in I can script something so when I do a commit in 'development', the same code is replicated to the other branches also? The only other option I have is to merge/diff the code branches (after checking them out individually) and then updating the code and pushing it every time I make a commit.

gagneet
  • 35,729
  • 29
  • 78
  • 113
  • not sure I get your question right. you mean in your Jenkinsfile the unitest or integration test parameters are different , which you are passing from Jenkinsfile and How you want to handle it with this many branches Because all the branches test parameter are different? – Samit Kumar Patel Feb 22 '21 at 20:42
  • Yes, we need to run certain tests for a basic smoke/bvt, others for development and unit-tests and all tests for main (regression). Current way to do this is to have different branches, as we do not have access to the Jenkins server, and then run each branch with the different tags from the Jenkinsfile script. But as the code for all is the same, only the tags (BDD based test feature files) to run differ, I need to maintain separate branches. – gagneet Mar 01 '21 at 00:32
  • Interesting... Let me create an example for this. – Samit Kumar Patel Mar 01 '21 at 12:47

0 Answers0