Yep, found "build" as well. I thought maybe it's done differently in 
declarative pipelines...

Ended up with the following, however despite this, it did not start.

post {
   // Run end-to-end tests, if requested
   success {
      script {
         if (BRANCH_NAME == "develop") {
            result = sh (script: "git log -1 | grep '.*\\[e2e\\].*'", 
returnStatus: true) 
            if (result == 0) {
               build job: '****', wait: false
            }
         }
      }
   }
}

The following was logged: 

+ git log -1
+ grep '.*\[e2e\].*'
    Run tests [e2e][Pipeline] build (Building ****)Scheduling item: * 
<https://security-services-jenkins.swg-devops.com/job/certificate-management-end-to-end-testing/>***


But when visiting that job's Stages View, there is no build running.
Could this be because the end-to-end job is also scheduled to run at 
specific time? Its Jenksinfile has the following specified: 

pipeline {
    triggers {

        cron ('0 12,16,20 * * 1-4,7')
    }
    ...


(run everyday except Friday and Saturday, at 12:00, 16:00 and 20:00).

On Wednesday, April 12, 2017 at 11:40:41 AM UTC+3, Danny Rehelis wrote:
>
> This is how I do this, should be easy enough -
>
> pipeline {
> stages {
>         stage ('xxx') {
>             steps {
> ...
> ...
>                 build job: '<job-name-here>', parameters: [
>                     string(name: 'PARAM1', value: "xxx"),
>                     string(name: 'PARAM2, value: "yyy")
>                 ]
>             }
>       }
> }
>
>
> On Wed, Apr 12, 2017 at 10:53 AM Idan Adar <id...@adar.me <javascript:>> 
> wrote:
>
>> Hi,
>>
>> Lets assume there are two job:
>>
>> 1. a job for a micro-service repository
>> 2. a job for end-to-end tests
>>
>> I'd like, in specific cases, to start the end-to-end tests job from the 
>> micro-service job.
>> For example, after introducing a change that even though passed unit 
>> testing and integration testing, it needs further testing, available in the 
>> end-to-end tests job.
>>
>> I'd like for the developers to make a commit with a specific phrase, e.g. 
>> "[e2e]" and to use it as follows (just pseudo code for now).
>>
>> pipeline {
>>     ...
>>     ...
>>     stages {
>>         ...
>>     }    
>>
>>
>>     post {
>>         success {
>>             if (BRANCH_NAME == "develop") {
>>                 result = sh (script: "git log -1 | grep '.*\\[e2e\\].*'", 
>> returnStatus: true) 
>>                 if (result == 0) {
>>                     // start the d2d job
>>                 }
>>             }
>>         }
>>     ...
>>     ...
>>     }
>> }
>>
>>
>>
>> -- 
>> 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-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/db4e7ca4-4a8b-4a70-ae49-6595eda541b7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/db4e7ca4-4a8b-4a70-ae49-6595eda541b7%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/aefb5f67-2901-4fa8-8630-e189320a0e8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to