У меня есть куча узлов, обслуживающих метки rhel6
, rhel7
.
Как выполнить myFunc()
на любых 2 узлах rhel6
и любых 3 узлах rhel7
- параллельно ?
def slaveList = ['rhel6', 'rhel6', 'rhel7', 'rhel7', 'rhel7']
def stageFunc (String slaveLabel) {
return {
// Run this stage on any available node serving slaveLabel
agent { label "${slaveLabel}" } // Error shown here.
stage {
myFunc()
}
}
}
pipeline {
agent any
stages {
stage('Start') {
steps {
script {
def stageMap = [:]
def i = 0
slaveList.each { s ->
stageMap[i] = stageFunc(s)
i++
}
parallel stageMap
}
}
}
}
}
Показана ошибка:
java.lang.NoSuchMethodError: No such DSL method 'agent' found among steps [archive, ...