aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/jshipit/JshipIT.java
diff options
context:
space:
mode:
authoraxtloss <axtlos@getcryst.al>2023-05-25 21:16:57 +0200
committeraxtloss <axtlos@getcryst.al>2023-05-25 21:16:57 +0200
commitfda79997703823e7d65e9f639a3247119a97e5b3 (patch)
tree6dae8fe59ef4b3246a2463b2bef7053387aac450 /src/main/java/io/github/jshipit/JshipIT.java
parent88ff8a69891ad8193876bd6fcad7524a57151e80 (diff)
downloadjshipit-fda79997703823e7d65e9f639a3247119a97e5b3.tar.gz
jshipit-fda79997703823e7d65e9f639a3247119a97e5b3.tar.bz2
Add function to start container
I cannot understand any of this anymore. Oh well :shipit:
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);
}