public void createMachine(String machinePath, String machineDriver, String machineName) { List<String> create = commandLineExecutor.execCommandAsArray(machinePath, "create", "--driver", machineDriver, machineName); printOutput(create); }
/** * Starts given docker machine. * * @param cliPathExec * location of docker-machine or null if it is on PATH. * @param machineName * to be started. */ public void startDockerMachine(String cliPathExec, String machineName) { commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec), "start", machineName); this.manuallyStarted = true; }
public DockerRequirement() { this.commandLineExecutor = new CommandLineExecutor(); this.resolver = new CubeDockerConfigurationResolver(new Top(), new DockerMachine(commandLineExecutor), new Boot2Docker(commandLineExecutor), new DefaultDocker(), new OperatingSystemResolver().currentOperatingSystem() ); }
public static String resolveDistro() { OperatingSystemFamilyInterface currentOSFamily = new OperatingSystemResolver().currentOperatingSystem().getFamily(); for (DockerMachineDistro distro : values()) { for (OperatingSystemFamily osFamily : distro.osFamily) { if (osFamily == currentOSFamily) { return distro.distro; } } } return null; }
@Test public void shouldSortSingleRootWithMultipleLinks() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_SINGLE_ROOT_AND_MULTIPLE_LINKS, "C", "A")); assertExecutionSteps(sorted, new String[] {"B"}, new String[] {"A", "C"}); }
public CubeRepresenter() { this.representers.put(PortBinding.class, new ToStringRepresent()); this.representers.put(ExposedPort.class, new ToStringRepresent()); this.representers.put(Image.class, new ToStringRepresent()); this.representers.put(Link.class, new ToStringRepresent()); addClassTag(DockerCompositions.class, Tag.MAP); }
/** * Checks if Docker Machine is installed by running docker-machine and inspect the result. * * @return true if it is installed, false otherwise. */ public boolean isDockerMachineInstalled() { return isDockerMachineInstalled(null); }
public static boolean ping(final String host, final int port, int totalIterations, long sleep, TimeUnit timeUnit) { return ping(totalIterations, sleep, timeUnit, new PingCommand() { @Override public boolean call() { return ping(host, port); } }); }
@Override protected String[] getCommandArguments(String cliPathExec) { return new String[] {createBoot2DockerCommand(cliPathExec), "ip"}; }
private static boolean nodeInStep(List<Step> steps, Node node) { for (Step step : steps) { if (step.contains(node)) { return true; } } return false; }
public DockerRequirement() { this.commandLineExecutor = new CommandLineExecutor(); this.resolver = new CubeDockerConfigurationResolver(new Top(), new DockerMachine(commandLineExecutor), new Boot2Docker(commandLineExecutor), new DefaultDocker(), new OperatingSystemResolver().currentOperatingSystem() ); }
public static String resolveDistro() { OperatingSystemFamilyInterface currentOSFamily = new OperatingSystemResolver().currentOperatingSystem().getFamily(); for (DockerMachineDistro distro : values()) { for (OperatingSystemFamily osFamily : distro.osFamily) { if (osFamily == currentOSFamily) { return distro.distro; } } } return null; }
public void createMachine(String machinePath, String machineDriver, String machineName) { List<String> create = commandLineExecutor.execCommandAsArray(machinePath, "create", "--driver", machineDriver, machineName); printOutput(create); }
/** * Starts given docker machine. * * @param cliPathExec * location of docker-machine or null if it is on PATH. * @param machineName * to be started. */ public void startDockerMachine(String cliPathExec, String machineName) { commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec), "start", machineName); this.manuallyStarted = true; }
/** * Checks if Docker Machine is installed by running docker-machine and inspect the result. * * @return true if it is installed, false otherwise. */ public boolean isDockerMachineInstalled() { return isDockerMachineInstalled(null); }
public static boolean ping(final DockerClientExecutor dockerClientExecutor, final String containerId, final String command, int totalIterations, long sleep, TimeUnit timeUnit) { return ping(totalIterations, sleep, timeUnit, new PingCommand() { @Override public boolean call() { return execContainerPing(dockerClientExecutor, containerId, command); } }); }
public void grantPermissionToDockerMachine(String machinePath) { List<String> chmod = commandLineExecutor.execCommandAsArray("chmod", "+x", machinePath); printOutput(chmod); }
public void stopDockerMachine(String cliPathExec, String machineName) { commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec), "stop", machineName); this.manuallyStarted = false; }
public void grantPermissionToDockerMachine(String machinePath) { List<String> chmod = commandLineExecutor.execCommandAsArray("chmod", "+x", machinePath); printOutput(chmod); }
public void stopDockerMachine(String cliPathExec, String machineName) { commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec), "stop", machineName); this.manuallyStarted = false; }