diff options
author | axtloss <axtlos@getcryst.al> | 2023-05-25 22:06:02 +0200 |
---|---|---|
committer | axtloss <axtlos@getcryst.al> | 2023-05-25 22:06:02 +0200 |
commit | cd0df48723ca7c603cececc3c65003bf43b09d59 (patch) | |
tree | 6f39ce65f7897dce1dc7a8ab6f4179a5aa2f3617 /src/main/java/io/github/jshipit/JshipIT.java | |
parent | 75bbdb15e6f90d4f690b839f6db0cedfb61045be (diff) | |
download | jshipit-cd0df48723ca7c603cececc3c65003bf43b09d59.tar.gz jshipit-cd0df48723ca7c603cececc3c65003bf43b09d59.tar.bz2 |
Add shell subcommand
Diffstat (limited to '')
-rwxr-xr-x | src/main/java/io/github/jshipit/JshipIT.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/io/github/jshipit/JshipIT.java b/src/main/java/io/github/jshipit/JshipIT.java index becd91b..1383d48 100755 --- a/src/main/java/io/github/jshipit/JshipIT.java +++ b/src/main/java/io/github/jshipit/JshipIT.java @@ -11,6 +11,7 @@ import com.beust.jcommander.Parameter; public class JshipIT { public JshipIT(String[] args) { + CommandShell commandShell = new CommandShell(); CommandStart commandStart = new CommandStart(); CommandCreate commandCreate = new CommandCreate(); CommandPull commandPull = new CommandPull(); @@ -18,6 +19,7 @@ public class JshipIT { .addCommand("create", commandCreate) .addCommand("pull", commandPull) .addCommand("start", commandStart) + .addCommand("shell", commandShell) .build(); commands.parse(args); @@ -33,8 +35,11 @@ public class JshipIT { } 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.runCommand(null); + ContainerManager containerManager = new ContainerManager(commandStart.containerName, commandStart.containerCommand, dataStore); + containerManager.runCommand(); + } else if (commands.getParsedCommand().equals("shell")) { + ContainerManager containerManager = new ContainerManager(commandShell.containerName, "/bin/sh", dataStore); // A proper linux system should always have /bin/sh, skill issue if it doesn't + containerManager.runCommand(); } |