Yes, I do the exact same thing, there is not trigger config in the pipeline 
script - but for me this does not work the way you describe it - the job at 
least has to run once. But you seem to use the cps block instead of the cpsScm 
block for you job-dsl configuration, not sure abut this...

pipelineJob("${folderName}/install") {
  triggers {
    bitbucketPush()
  }
  definition {
    cpsScm { 
      scm { 
        git { 
          remote {
            url('https://bitbucket.org/xxxxx')
            credentials('BITBUCKET_CRED')
          } 
          branches('develop') 
          scriptPath(’install.groovy') 
          lightweight(true)
          extensions { 
            localBranch()
            cleanCheckout()
          }  
        } 
      } 
    }       
  }
}

/Domi


> On 3 Dec 2018, at 13:38, Tomas Bjerre <tomas.bjerr...@gmail.com> wrote:
> 
> But I don't configure the trigger part with a pipeline script.
> 
> I use Job DSL to create a pipeline job. In that pipeline job I configure the 
> triggering-part with Job DSL and only keep the build process in the pipeline 
> script.
> 
> Then I don't have to run the pipeline script once before it all works.
> 
> Like this:
> 
> pipelineJob("my pipeline job") {
>  triggers {
>   .... // Job DSL with triggering configuration
>  }
>  
>  definition {
>   cps {
>    script(...) //Pipeline with build process
>    sandbox()
>   }
>  }
> }
> 
> 
> 
> Den mån 3 dec. 2018 kl 13:20 skrev domi <d...@fortysix.ch 
> <mailto:d...@fortysix.ch>>:
> Hi Tomas,
> I do this too, but this does not mean I don’t have to start the build at 
> least once to make the webhooks work.
> /Domi
> 
>> On 3 Dec 2018, at 09:25, Tomas Bjerre <tomas.bjerr...@gmail.com 
>> <mailto:tomas.bjerr...@gmail.com>> wrote:
>> 
>> Regarding configuration of webhooks with pipelines. This is why I always 
>> configure that with Job DSL. I configure the Jenkins job and the Git service 
>> (usually some rest-call) in the same Groovy (Job DSL) script.
>> 
>> Den måndag 3 december 2018 kl. 09:15:05 UTC+1 skrev domi:
>> Thanks Jesse, it probably is, but even though - do you see a chance to fix 
>> the issues I mentioned? 
>> e.g. why do I need to run a pipeline once before it accepts webhooks from 
>> GitHub or Bitbucket? I do understand that I can configure additional SCM 
>> sources from within a pipeline, but why does it not listen on the one I have 
>> defined on the I have defined to load the "Pipeline from SCM”? 
>> /Domi 
>> 
>> > On 30 Nov 2018, at 17:59, Jesse Glick <jgl...@cloudbees.com <>> wrote: 
>> > 
>> > The simplest approach, starting from what you are doing now, would be 
>> > to keep the build records and other state files from your Jenkins 
>> > installation, recreating only the configuration files from Git. 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google Groups 
>> > "Jenkins Developers" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to jenkinsci-de...@googlegroups.com <>. 
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1W_8-%3DU8GJSuw_oazA0PSiXGyYDhv8mSKzLV0bScStFg%40mail.gmail.com
>> >  
>> > <https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1W_8-%3DU8GJSuw_oazA0PSiXGyYDhv8mSKzLV0bScStFg%40mail.gmail.com>.
>> >  
>> > For more options, visit https://groups.google.com/d/optout 
>> > <https://groups.google.com/d/optout>. 
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-dev+unsubscr...@googlegroups.com 
>> <mailto:jenkinsci-dev+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/d21bf102-f345-4c6b-a234-4ab8ad3c6995%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/d21bf102-f345-4c6b-a234-4ab8ad3c6995%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Jenkins Developers" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jenkinsci-dev/1gc8t6MAl4g/unsubscribe 
> <https://groups.google.com/d/topic/jenkinsci-dev/1gc8t6MAl4g/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> jenkinsci-dev+unsubscr...@googlegroups.com 
> <mailto:jenkinsci-dev+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/A03F3239-D428-4EC3-8167-E7C3AD02CE7C%40fortysix.ch
>  
> <https://groups.google.com/d/msgid/jenkinsci-dev/A03F3239-D428-4EC3-8167-E7C3AD02CE7C%40fortysix.ch?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-dev+unsubscr...@googlegroups.com 
> <mailto:jenkinsci-dev+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/CAK89W5K9YFGn%2BC4rELF12u68QOY%2Bye978a1SJCrQwJ%2Bs8h6N2g%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAK89W5K9YFGn%2BC4rELF12u68QOY%2Bye978a1SJCrQwJ%2Bs8h6N2g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/AD53862A-52F5-4CA9-B552-C61A2DE1DF05%40fortysix.ch.
For more options, visit https://groups.google.com/d/optout.

Reply via email to