Jenkins实现多Windows主机并发构建
直接上pipeline源码:
node {
stage('Parallel Stage') {
parallel 'ok' : {
def remote = [:]
remote.name = "test01"
remote.host = "192.168.xx.xxx"
remote.allowAnyHosts = true
remote.user = 'xxx'
remote.password = 'xxxxxx'
stage("test01-build") {
sshCommand remote: remote, command: "C:/jenkins/ppp.bat"
}
},'okk' : {
def remote = [:]
remote.name = "test02"
remote.host = "192.168.xx.xxx"
remote.allowAnyHosts = true
remote.user = 'xxx'
remote.password = 'xxxxxx'
stage("test02-build") {
sshCommand remote: remote, command: "C:/jenkins/qqq.bat"
}
}
}
}
更多主机的话,继续如上添加