diff --git a/src/main/java/org/jenkinsci/plugins/docker/swarm/DockerSwarmComputerLauncher.java b/src/main/java/org/jenkinsci/plugins/docker/swarm/DockerSwarmComputerLauncher.java index b883765..9ffb45b 100755 --- a/src/main/java/org/jenkinsci/plugins/docker/swarm/DockerSwarmComputerLauncher.java +++ b/src/main/java/org/jenkinsci/plugins/docker/swarm/DockerSwarmComputerLauncher.java @@ -81,6 +81,7 @@ private void launch(final DockerSwarmComputer computer, final TaskListener liste final String[] envVarOptions = dockerSwarmAgentTemplate.getEnvVarsConfig(); final ArrayList envVarsList = new ArrayList<>(Arrays.asList(envVarOptions)); envVarsList.add("DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET=" + getAgentSecret(computer)); + envVarsList.add("DOCKER_SWARM_PLUGIN_JENKINS_URL=" + getJenkinsUrl(configuration)); envVarsList.add("DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL=" + getAgentJarUrl(configuration)); envVarsList.add("DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JNLP_URL=" + getAgentJnlpUrl(computer, configuration)); envVarsList.add("DOCKER_SWARM_PLUGIN_JENKINS_AGENT_NAME=" + getAgentName(computer)); @@ -89,7 +90,9 @@ private void launch(final DockerSwarmComputer computer, final TaskListener liste if (dockerSwarmAgentTemplate.isOsWindows()) { String command = dockerSwarmAgentTemplate.getWindowsCommand(); HashMap envHashMap = new HashMap(){{ + // TODO derive automatically from above list put("\\%DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET\\%",getAgentSecret(computer)); + put("\\%DOCKER_SWARM_PLUGIN_JENKINS_URL\\%",getJenkinsUrl(configuration)); put("\\%DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL\\%",getAgentJarUrl(configuration)); put("\\%DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JNLP_URL\\%",getAgentJnlpUrl(computer, configuration)); put("\\%DOCKER_SWARM_PLUGIN_JENKINS_AGENT_NAME\\%",getAgentName(computer)); diff --git a/src/main/resources/org/jenkinsci/plugins/docker/swarm/DockerSwarmAgentTemplate/config.jelly b/src/main/resources/org/jenkinsci/plugins/docker/swarm/DockerSwarmAgentTemplate/config.jelly index 1ae2b31..2487d12 100755 --- a/src/main/resources/org/jenkinsci/plugins/docker/swarm/DockerSwarmAgentTemplate/config.jelly +++ b/src/main/resources/org/jenkinsci/plugins/docker/swarm/DockerSwarmAgentTemplate/config.jelly @@ -10,10 +10,10 @@ - + - +