Beispiel #1
0
        public static async Task ExecuteAsync(OutputContext output, ContainerEngine containerEngine, string imageName, string imageTag)
        {
            if (output is null)
            {
                throw new ArgumentNullException(nameof(output));
            }

            if (imageName is null)
            {
                throw new ArgumentNullException(nameof(imageName));
            }

            if (imageTag is null)
            {
                throw new ArgumentNullException(nameof(imageTag));
            }

            output.WriteDebugLine("Running 'docker push'.");
            output.WriteCommandLine("docker", $"push {imageName}:{imageTag}");
            var capture  = output.Capture();
            var exitCode = await containerEngine.ExecuteAsync(
                $"push {imageName}:{imageTag}",
                stdOut : capture.StdOut,
                stdErr : capture.StdErr);

            output.WriteDebugLine($"Done running 'docker push' exit code: {exitCode}");
            if (exitCode != 0)
            {
                throw new CommandException("'docker push' failed.");
            }
        }
Beispiel #2
0
 public ApplicationBuilder(FileInfo source, string name, ContainerEngine containerEngine, int?dashboardPort)
 {
     Source          = source;
     Name            = name;
     ContainerEngine = containerEngine;
     DashboardPort   = dashboardPort;
 }
Beispiel #3
0
 public ApplicationBuilder(FileInfo source, string name, ContainerEngine containerEngine)
 {
     Source          = source;
     Name            = name;
     ContainerEngine = containerEngine;
 }