maven - How to SSH into jenkins host executing code -
i have jenkins job set , i'm having issues getting around company's proxy. i'd ssh jenkins slave executing job.
where find host name in jenkins?
so can add proper proxy settings.xml file. should located {home}/.m2/settings.xml
inspired answer. running groovy script on jenkins script console list slaves , ip address.
import hudson.util.remotingdiagnostics; print_ip = 'println inetaddress.localhost.hostaddress'; print_hostname = 'println inetaddress.localhost.canonicalhostname'; // here - shell command, uname example uname = 'def proc = "uname -a".execute(); proc.waitfor(); println proc.in.text'; (slave in hudson.model.hudson.instance.slaves) { println slave.name; println remotingdiagnostics.executegroovy(print_ip, slave.getchannel()); }
Comments
Post a Comment