public boolean isDocker() {
return imageSection.isSpecified();
}
public ShellCommands getDockerBuildRunScriptForLocal(String buildId, Map<String, String> envVars, String buildCommand) {
ShellCommands commands = new ShellCommands();
String buildImageCommand = dockerCommand("build").flag("t").args(buildId, ".").get();
commands.add(buildImageCommand);
// If we are running a command in the container and we have services to link to, try socat
if (servicesSection.isSpecified()) {
buildCommand = buildCommandAmbassador(buildCommand);
}
/* @formatter:off */
DockerCommandBuilder runCommand = dockerCommand("run")
.flag("rm")
.flag("sig-proxy=true")
.args(buildId, buildCommand);
exportEnvVars(runCommand, envVars);
/* @formatter:on */
if (servicesSection.isSpecified()) {
commands.addAll(servicesSection.getServiceStartCommands(buildId));
for (String link : servicesSection.getContainerLinkCommands(buildId)) {
runCommand.flag("link", link);
}
}
commands.add(runCommand.get());
return commands;
}