Open iamminji opened 3 years ago
I solved it as below.
ssh.run {
for (Remote source : allSessions) {
Remote target = source
println "$source.host"
session(target) {
// `source` and `target` became the same.
println "$target.host"
}
}
}
But I am still wondering why.
Environment info
2.10.1
I made a list(In the code below, this is
allSessions
) as below to manage the host as a file. I put the session in the for loop and proceeded, but it did not work as expected.The data(Remote) information in the session is different from the data(Remote) information outside the session.
Remote in session does not traverse all session lists. It is fixed as one of the list(
allSessions
). (I would like to run the deployment in parallel)