On Tuesday, November 12, 2019 at 3:58:41 AM UTC+5:30, Jerome Godbout wrote: > > Hi, > I'm using my Jenkins file pipeline to checkout and build, I have a > pipeline project I would like to get triggered only when a push to a > specific branch occur. The Git repos is host on bitbucket cloud services. I > cannot make a webhook, since the Jenkins run on an intranet and cannot be > access from the web. > > Is there a way to trigger on a push on release/test and not on master or > any other branch for example? how can I do this? > > my pipeline checkout look like this so far: > checkout([$class: 'GitSCM' > , branches: [[name: repos['branch']]] > , browser: [$class: 'BitbucketWeb', repoUrl: repos['url']] > , doGenerateSubmoduleConfigurations: false > , extensions: [[$class: 'CloneOption', noTags: false], > [$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', > disableSubmodules: false, parentCredentials: true, recursiveSubmodules: > true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout'], > [$class: 'CleanBeforeCheckout']] > , submoduleCfg: [] > , userRemoteConfigs: [[credentialsId: 'BitBucketAmotus', > url: repos['url']]] > ]); > > Maybe, you could add a check (prior to the checkout stage) for the incoming branch, if it's per the requirements, then move on to build other stages.
/Ram -- 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/fb0fc089-4ecf-4dcf-8318-cdfb54079614%40googlegroups.com.