示例1:
pipeline{ agent {label "xxx"} // label is a special machine registered in Jenkins environment{ CLONE_TRAINER_TEST_CMD = ''' cd $wksp // shell command ''' START_TRAINER_TEST_CLIENT_CMD = ''' // shell command ''' } stages{ stage("xxx"){ // can define by yourself, it will display in the beginning of Jenkins output log parallel{ stage("xxx"){ // define task scenaria, such as 'build' agent {label "xxx"} // a special machine steps{ sh env.CLONE_TRAINER_TEST_CMD sh ''' cd $wksp // shell command ''' } } stage("xxx"){ agent {label "xxx"} steps{ // shell command } } } } } }