aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/jshipit/JshipIT.java
diff options
context:
space:
mode:
authoraxtloss <axtlos@getcryst.al>2023-05-29 23:56:25 +0200
committeraxtloss <axtlos@getcryst.al>2023-05-29 23:56:25 +0200
commit3bfe8ba05a429e726001b88c63f736f1bbed3509 (patch)
tree0e7d3cb0e38ea9111c7c05e63d3b05cfeda74825 /src/main/java/io/github/jshipit/JshipIT.java
parent87cc052844e2cacca591edd68884f1e7f6c49a3a (diff)
downloadjshipit-3bfe8ba05a429e726001b88c63f736f1bbed3509.tar.gz
jshipit-3bfe8ba05a429e726001b88c63f736f1bbed3509.tar.bz2
Allow bind mounting from host into container
Diffstat (limited to 'src/main/java/io/github/jshipit/JshipIT.java')
-rwxr-xr-xsrc/main/java/io/github/jshipit/JshipIT.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/io/github/jshipit/JshipIT.java b/src/main/java/io/github/jshipit/JshipIT.java
index 76f224b..4304051 100755
--- a/src/main/java/io/github/jshipit/JshipIT.java
+++ b/src/main/java/io/github/jshipit/JshipIT.java
@@ -25,7 +25,7 @@ public class JshipIT {
commands.parse(args);
- OCIDataStore dataStore = new OCIDataStore(System.getenv("HOME") + "/.local/share/dataStore");
+ OCIDataStore dataStore = new OCIDataStore(System.getenv("HOME") + "/.local/share/jshipit/dataStore");
if (commands.getParsedCommand() == null) {
commands.usage();
@@ -45,11 +45,11 @@ public class JshipIT {
String containerRepo = String.join("/", image);
// Convert the registry name to the OCI registry name
- if (apiRepo == "docker.io") {
+ if (apiRepo.equalsIgnoreCase("docker.io")) {
apiRepo = "registry.docker.io";
}
- ContainerManager containerManager = new ContainerManager(commandCreate.containerName, containerImage, commandCreate.containerImage.split(":")[1], apiRepo, containerRepo, dataStore);
+ ContainerManager containerManager = new ContainerManager(commandCreate.containerName, containerImage, commandCreate.containerImage.split(":")[1], apiRepo, containerRepo, null, dataStore);
containerManager.createContainer();
} else if (commands.getParsedCommand().equals("pull")) {
@@ -62,20 +62,20 @@ public class JshipIT {
String containerRepo = String.join("/", image);
// Convert the registry name to the OCI registry name
- if (apiRepo == "docker.io") {
+ if (apiRepo.equalsIgnoreCase("docker.io")) {
apiRepo = "registry.docker.io";
}
System.out.println("Pulling image " + containerImage + " from " + apiRepo + "/" + containerRepo);
dataStore.createImage(apiRepo, containerRepo, containerImage, commandPull.containerImage.split(":")[1]);
} else if (commands.getParsedCommand().equals("start")) {
- ContainerManager containerManager = new ContainerManager(commandStart.containerName, commandStart.containerCommand, dataStore);
+ ContainerManager containerManager = new ContainerManager(commandStart.containerName, commandStart.containerCommand, commandStart.containerMount, 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 containerManager = new ContainerManager(commandShell.containerName, "/bin/sh", commandShell.containerMount, dataStore); // A proper linux system should always have /bin/sh, skill issue if it doesn't
containerManager.runCommand();
} else if (commands.getParsedCommand().equals("delete")) {
- ContainerManager containerManager = new ContainerManager(commandDelete.containerName, null, dataStore);
+ ContainerManager containerManager = new ContainerManager(commandDelete.containerName, null, null, dataStore);
containerManager.deleteContainer();
}
}