确定执行机器和自定义工作目录(忽略节点的workspace)
pipeline{
agent {
node {
label "XXXXX"
customWorkspace "E:/workspace/"
}
}
parameters {
}
options {
}
stages {
}
post {
}
}
仅确定执行机器
pipeline{
agent { label "XXXXX" }
parameters {
}
options {
}
stages {
}
post {
}
}
待确定执行机器(多级stage分类,在stage下再定义执行机器)
pipeline{
agent none
parameters {
}
options {
}
stages {
stage('STAGE: 阶段1') {
stages {
stage('阶段1-任务1') {
agent { label "NODE_1" } // 在此处定义二级stages执行机
steps {
script {
sh(script:"uname -a")
}
}
}
}
}
}
post {
}
}