set correct slave port from env

>groovy.lang.MissingPropertyException: No such property: env for class: tcp-slave-agent-port
This commit is contained in:
Dmitry Gureev 2015-08-14 02:39:55 +03:00
parent 01b970ddf2
commit 1a6501604a
1 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,8 @@ import jenkins.model.*;
Thread.start {
sleep 10000
println "--> setting agent port for jnlp"
Jenkins.instance.setSlaveAgentPort(env['JENKINS_SLAVE_AGENT_PORT'])
def env = System.getenv()
int port = env['JENKINS_SLAVE_AGENT_PORT'].toInteger()
Jenkins.instance.setSlaveAgentPort(port)
println "--> setting agent port for jnlp... done"
}