aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/jshipit/JshipIT.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/jshipit/JshipIT.java')
-rwxr-xr-xsrc/main/java/io/github/jshipit/JshipIT.java10
1 files changed, 7 insertions, 3 deletions
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);
}