смотри как сделать следующее
def remote = [:]
remote.name1 = "node1"
remote.host1 = "
192.168.1.201"
remote.name = "node1"
remote.host2 = "
192.168.1.202"
remote.name2 = "node2"
....
remote.host30 = "
192.168.1.230"
remote.allowAnyHosts = true
remote.user = 'ubuntu'
remote.password = 'password'
.......
node node1 {
withCredentials([usernamePassword(credentialsId: 'plainssh', passwordVariable: 'password', usernameVariable: 'ubuntu')]) {
// some block
stage("SSH Steps Rocks!") {
sshCommand remote: remote, command: 'usr/bin/stopNode && /usr/bin/syncNode
&& /usr/bin/startNode''
}
}
}
....
node node30{
withCr....
sshCommand remote: remote, command: 'usr/bin/stopNode && /usr/bin/syncNode
&& /usr/bin/startNode''
....