public string SshCall(CiExeCommand command) { return(sshClient .Connect(this.connection) .ScriptWithStdIn( DockerRun(command.CommandLine), command.CommandLine + ".sh", new string[] { "uri ", vaultUri.ToString(), "token : ", vaultToken })); }
public CiExeCommands( InstallCA installCA, InstallRegistry installRegistry, InstallVault installVault, BuildWebApp1 buildWebApp1, // WebServer InstallTraefik installTraefik, InstallWebApp installWebApp, ISshClient sshClient ) { volume1 = "--volume /var/run/docker.sock:/var/run/docker.sock "; volume2 = "--volume " + "/cidata" + ":/cidata "; this.InstallCA = Create <InstallCA>("install-ca", async() => await installCA.Install()); this.CleanCA = Create <InstallCA>("clean-ca", async() => await installCA.Clean()); this.InstallRegistry = Create <InstallRegistry>("install-registry", async() => await installRegistry.Install()); this.CleanRegistry = Create <InstallRegistry>("clean-registry", async() => await installRegistry.Clean()); this.InstallVault = Create <InstallVault>("install-vault", async() => await installVault.Init()); this.BuildWebApp1 = Create <BuildWebApp1>("build-webapp1", async() => await buildWebApp1.Build()); this.CleanWebApp1 = Create <BuildWebApp1>("clean-webapp1", async() => await buildWebApp1.CleanBuild()); this.PublishWebApp1 = Create <BuildWebApp1>("publish-webapp1", async() => await buildWebApp1.Publish()); this.UnpublishWebApp1 = Create <BuildWebApp1>("cleanpublish-webapp1", async() => await buildWebApp1.CleanPublish()); // Webserver this.InstallTraefik = Create <InstallTraefik>("webserver-install-webapp1", async() => await installTraefik.Install()); this.CleanTraefik = Create <InstallTraefik>("clean-webapp1", async() => await installTraefik.Clean()); this.InstallWebApp1 = Create <InstallWebApp>("webserver-install-webapp1", async() => await installWebApp.Install()); this.CleanInstallWebApp1 = Create <InstallWebApp>("clean-webapp1", async() => await installWebApp.CleanInstall()); this.sshClient = sshClient; }
private CiExeCommand <T> Create <T>(string commandLine, Func <Task> action) { var cliCmd = new CiExeCommand <T>(this, commandLine, action); return(cliCmd); }