Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-24043] Expand env. vars in wait for ports field
  • Loading branch information
vjuranek committed Aug 4, 2014
1 parent 37aab42 commit abe5845
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit abe5845

Please sign in to comment.