Как запустить код двух ветвей параллельно в конвейере jenkins?
Мне нужно запустить код Newman параллельно в конвейере. Я столкнулся с проблемой при запуске кода Newman:
parallel firstBranch: {
node{
sh "newman run 'XYZ.json' --insecure"
}
},
secondBranch
node{
sh "newman run 'XYX.json' --insecure"
}
},
failFast: true|false
Я получаю код ошибки как:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.jenkinsci.plugins.docker.workflow.Docker.call() is applicable for argument types: (org.jenkinsci.plugins.workflow.cps.CpsClosure2) values: [org.jenkinsci.plugins.workflow.cps
Possible solutions: wait(), any(), wait(long), each(groovy.lang.Closure), any(groovy.lang.Closure), grep()
1 ответ
У вас есть синтаксические ошибки в вашем конвейере, например secondBranch без ": {", вы можете попробовать, как этот пример, взятый из документации Jenkins:
stages {
stage('Run Tests') {
parallel {
stage('Test On Windows') {
agent {
label "windows"
}
steps {
bat "run-tests.bat"
}
post {
always {
junit "**/TEST-*.xml"
}
}
}
stage('Test On Linux') {
agent {
label "linux"
}
steps {
sh "run-tests.sh"
}
post {
always {
junit "**/TEST-*.xml"
}
}
}
}
}
}