package io.github.jshipit; import com.beust.jcommander.JCommander; import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import com.beust.jcommander.Parameter; public class JshipIT { public JshipIT(String[] args) { CommandCreate commandCreate = new CommandCreate(); CommandPull commandPull = new CommandPull(); JCommander commands = JCommander.newBuilder() .addCommand("create", commandCreate) .addCommand("pull", commandPull) .build(); commands.parse(args); OCIDataStore dataStore = new OCIDataStore("./tmp"); if (commands.getParsedCommand() == null) { 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.createContainer(); containerManager.startContainer(); } else if (commands.getParsedCommand().equals("pull")) { dataStore.createImage(commandPull.containerApiRepo, commandPull.containerRepo, commandPull.containerImage, commandPull.containerTag); } } }