Replies inline On Tue, Oct 30, 2018 at 7:43 AM touseef <touseefspe...@gmail.com> wrote:
> Hi , > > I have a source code repository having multiple branches say branch1, > branch2 and so on. > > Currently i have a jenkins jobs which builds the master or whatever i > specify in job configuration.Now what i wish to achieve is if i commit my > changes to branch 1 , my jenkins job should automatically context switch > from master to branch1 and build that, and in the next step if i commit on > branch2 it should build branch 2. > > i am able to make rest calls via DSL script to get the branch names and > then use job dsl to create the jobs as the number of branches are > present. > However i don't want multiple jobs. What i am looking is having a single > intelligent job to do the context switching between jobs. > > Can you further explain why you want a "single intelligent job to do the context switching"? That is a technique that was used in the past with Jenkins freestyle jobs. The technique makes it very hard to diagnose the locations of test failures, or the place where a compilation failure happened, or the differences from one job to the next. If you're not using Pipeline jobs, then having a single job which builds any of several branches is relatively easy (add the branch names to build), though it will tend to confuse most users. If you're using Pipeline jobs, you'll likely be much happier with a multibranch pipeline so that each branch gets its own job and job history and so that new jobs are created automatically for new branches and are automatically destroyed for deleted branches. Mark Waite > Any idea or help will be appreciated. > > Thanks, > Touseef > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to jenkinsci-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/3543d8da-3c80-4764-bc7c-092053f8c103%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/3543d8da-3c80-4764-bc7c-092053f8c103%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHHTJeWtSCsU5gGfCKf-qhH0OH21fGW1gDNteU%2BD4oLvw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.