You can't do it on the triggers level ( the trigger config only can affect the next run, as the job is already triggered), but you can wrap the whole work in the pipeline in a when, so if the branch is a userbranch this run is mostly a do-nothing.
Björn [email protected] schrieb am Mittwoch, 27. Oktober 2021 um 13:40:43 UTC+2: > User branches are like > origin/username/CICD > Official branches are origin/CICD og origin/master > > All part of the same project. > CICD branch has a different Declarative Pipeline for CICD release build > and deployment. > Same goes for user branches that are based on this CICD branch. > > All other branches have our standard Scripted Pipeline. > So we have already splitt different pipelines for these. > > When all branches based on CICD are building, we don't want to build > release and deploy from user branches of it, only the origin/CICD. > I wanted to avoid username/CICD being automatically triggered and built > when origin/master had built. It should only trigger on origin/CICD. > > onsdag 27. oktober 2021 kl. 09:25:01 UTC+2 skrev [email protected]: > >> I'm not sure if I understood correctly what user branches of the CICD >> mean in this particular case, can you clarify it? >> Some other questions: >> - Are the master and CICD branches part of the same projectA? >> - If so, how do users interact with the project? >> >> As far as I see the upstream trigger option allows to listen for changes >> in some other projects. >> >> Will it work if you split two pipelines instead? >> >> *Pipeline for the master branch * >> >> or even a multibranch pipeline if needed, then you can exclude the CICD >> branch to be built. >> >> *Pipeline for the branch CICD* >> >> or event a multibranch pipeline if needed, then you can exclude >> everything but the CICD branch. >> >> triggers { >> upstream("projectA/master'") >> } >> >> >> Cheers >> >> On Friday, 22 October 2021 at 11:17:46 UTC+1 [email protected] wrote: >> >>> We have a branch in projectA called CICD. >>> This branch we want to be triggered automatically after the master >>> branch has built. >>> However we do not want user branches of the CICD to be triggered >>> automatically. >>> >>> Is it possible to avoid configuring a trigger if the branch is not CICD? >>> >>> This is probably not possible, but would be very useful. >>> >>> triggers { >>> upstream 'projectA/master' >>> when { >>> branch 'CICD' >>> } >>> } >>> >> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/11989e22-3aa3-47d4-85c9-b4222c70f060n%40googlegroups.com.
