Skip to content
Permalink
Browse files
[FIXED JENKINS-24043] Expand env. vars in wait for ports field
  • Loading branch information
vjuranek committed Aug 4, 2014
1 parent 37aab42 commit abe584574425da4ddd98ebc823889e942607e9da
Showing 1 changed file with 5 additions and 3 deletions.
@@ -3,6 +3,7 @@
import hudson.Extension;
import hudson.model.AbstractBuild;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -82,7 +83,8 @@ public void execute(@SuppressWarnings("rawtypes") AbstractBuild build, ConsoleLo

// wait for ports
if (waitPorts != null && !waitPorts.isEmpty()) {
waitForPorts(client, console);
String waitPortsResolved = Resolver.buildVar(build, waitPorts);
waitForPorts(waitPortsResolved, client, console);
}
}

@@ -113,8 +115,8 @@ private Ports parsePortBindings(String bindings) throws IllegalArgumentException
return ports;
}

private void waitForPorts(DockerClient client, ConsoleLogger console) throws DockerException {
Map<String, List<Integer>> containers = PortUtils.parsePorts(waitPorts);
private void waitForPorts(String waitForPorts, DockerClient client, ConsoleLogger console) throws DockerException {
Map<String, List<Integer>> containers = PortUtils.parsePorts(waitForPorts);
for (String cId : containers.keySet()) {
ContainerInspectResponse inspectResp = client.execute(client.inspectContainerCmd(cId));
String ip = inspectResp.getNetworkSettings().getIpAddress();

0 comments on commit abe5845

Please sign in to comment.