Reputation: 5220
I would like to do this, but in the Jenkins DSL:
If found somewhere this, but it's not working:
job('ps-first') {
steps { shell('echo "landing"') }
postBuildSteps { ...run other job here... }
configure {
it <<
'runPostStepsIfResult' { name('SUCCESS') }
}
}
Upvotes: 2
Views: 5212
Reputation: 336
As explained in https://jenkinsci.github.io/job-dsl-plugin/#path/freeStyleJob-publishers-downstream
job('ps-first') {
...
publishers {
downstream('ps-archive', 'SUCCESS')
}
}
Upvotes: 2
Reputation: 5220
I found what I was looking for!
First step was look how the xml is generated from my UI -> go to url and replace config path with config.xml Then find publishers in the documentation
Upvotes: 3
Reputation: 3887
Please take a look at https://your-jenkins-server/pipeline-syntax
on your own jenkins server. This snippet generator can create a lot of snippets based on the plugins you have installed.
For your post-build step I think what you are looking for is
build job: 'ps-archive', parameters: [
string(name: 'Param1', value: 'someValue'),
booleanParam(name: 'Bool', value: false,
...
], quietPeriod: 2, wait: false
You can leave out quietPeriod
if it should start immediate.
Upvotes: 1