In the following workflow I need to get the hostname of the parent node.
node('clifford') {
sh "sh create-modules-list.sh > modules.txt"
}
def branches = [:]
branches["build1"] = {
node('clifford') {
ws {
sh "ssh build@${PARENT_HOST} 'bash -s' < get-next-module.sh /var/lib/build/workspace/test-workflow/modules.txt 2>&1"
}
}
}
Is it possible to pass the hostname as parameter?
I could write the hostname to a file and archive/unarchive it to read the hostname from there. But maybe there is an easier way?
Thanks
Clifford