How to configure multiple shell steps within Job DSL

2k Views Asked by At

How can i configure multiple shell steps within Job DSL?
I am configuring a single shell step as below:

project / builders / 'hudson.tasks.Shell' {
command 'cd $WORKSPACE/dir1'
}
1

There are 1 best solutions below

0
On BEST ANSWER

I found that I should be able to use the shell() method, which can be called multiple times to create multiple shell steps.

https://jenkinsci.github.io/job-dsl-plugin/#path/freeStyleJob-steps-shell