From fda79997703823e7d65e9f639a3247119a97e5b3 Mon Sep 17 00:00:00 2001 From: axtloss Date: Thu, 25 May 2023 21:16:57 +0200 Subject: Add function to start container I cannot understand any of this anymore. Oh well :shipit: --- src/main/java/io/github/jshipit/JshipIT.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/io/github/jshipit/JshipIT.java') diff --git a/src/main/java/io/github/jshipit/JshipIT.java b/src/main/java/io/github/jshipit/JshipIT.java index d51ddbe..9d109ba 100755 --- a/src/main/java/io/github/jshipit/JshipIT.java +++ b/src/main/java/io/github/jshipit/JshipIT.java @@ -11,12 +11,13 @@ import com.beust.jcommander.Parameter; public class JshipIT { public JshipIT(String[] args) { - + CommandStart commandStart = new CommandStart(); CommandCreate commandCreate = new CommandCreate(); CommandPull commandPull = new CommandPull(); JCommander commands = JCommander.newBuilder() .addCommand("create", commandCreate) .addCommand("pull", commandPull) + .addCommand("start", commandStart) .build(); commands.parse(args); @@ -27,11 +28,14 @@ public class JshipIT { commands.usage(); System.exit(1); } else if (commands.getParsedCommand().equals("create")) { - ContainerManager containerManager = new ContainerManager(commandCreate.containerName, commandCreate.containerImage, commandCreate.containerTag, "bash", commandCreate.containerApiRepo, commandCreate.containerRepo, dataStore); + ContainerManager containerManager = new ContainerManager(commandCreate.containerName, commandCreate.containerImage, commandCreate.containerTag, commandCreate.containerApiRepo, commandCreate.containerRepo, dataStore); containerManager.createContainer(); - containerManager.startContainer(); } else if (commands.getParsedCommand().equals("pull")) { dataStore.createImage(commandPull.containerApiRepo, commandPull.containerRepo, commandPull.containerImage, commandPull.containerTag); + } else if (commands.getParsedCommand().equals("start")) { + ContainerManager containerManager = new ContainerManager(commandStart.containerName, dataStore); + containerManager.startContainer(); + containerManager.runCommand(null); } -- cgit v1.2.3