예제 #1
0
 private static void RunTests()
 {
     if (!Options.IsTestRunDisabled)
     {
         WriteHeading("TESTING IMAGES");
         foreach (string command in RepoInfo.TestCommands)
         {
             string[] parts = command.Split(' ');
             ExecuteHelper.Execute(
                 parts[0],
                 command.Substring(parts[0].Length + 1),
                 Options.IsDryRun);
         }
     }
 }
예제 #2
0
        private static void BuildImages()
        {
            WriteHeading("BUILDING IMAGES");
            foreach (ImageInfo imageInfo in RepoInfo.Images.Where(image => image.Platform != null))
            {
                Console.WriteLine($"-- BUILDING: {imageInfo.Platform.Model.Dockerfile}");
                if (!Options.IsSkipPullingEnabled && imageInfo.Platform.IsExternalFromImage)
                {
                    // Ensure latest base image exists locally before building
                    ExecuteHelper.ExecuteWithRetry("docker", $"pull {imageInfo.Platform.FromImage}", Options.IsDryRun);
                }

                ExecuteHelper.Execute(
                    "docker",
                    $"build -t {string.Join(" -t ", imageInfo.Tags)} {imageInfo.Platform.Model.Dockerfile}",
                    Options.IsDryRun);
            }
        }