pipeline实现多windows主机并发构建

直接上源码:

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"
    }
  }
  }
}

更多主机的话,继续如上添加

你可能感兴趣的:(jenkins,kubernetes)