示例#1
0
        /// <inheritdoc/>
        public IEnumerable <V1Container> GetContainersFor(StepNumber number, ImprovementContext context)
        {
            var containers = new List <V1Container>();

            if (!context.PullRequest)
            {
                containers.Add(new V1Container {
                    Name         = "git-update-repository",
                    Image        = "dolittlebuild/sourcecontrol-git-update:1.0.0",
                    Command      = new [] { "/bin/sh", "/usr/bin/update_repository.sh", "/source/", context.Improvable.SourceControl.Repository },
                    VolumeMounts = new []   {
                        new V1VolumeMount {
                            Name      = "azure",
                            SubPath   = context.GetImprovableSubPath("source"),
                            MountPath = "/source/",
                        },
                    },
                });
            }

            containers.Add(new V1Container {
                Name         = "copy-source-from-repository",
                Image        = "alpine:3.9",
                Command      = new [] { "/bin/cp", "-R", "/repository/.", "/source/" },
                VolumeMounts = new []   {
                    new V1VolumeMount {
                        Name      = "azure",
                        SubPath   = context.GetImprovableSubPath("source"),
                        MountPath = "/repository/",
                    },
                    new V1VolumeMount {
                        Name      = "workdir",
                        SubPath   = "source",
                        MountPath = "/source/",
                    },
                },
            });

            if (context.PullRequest)
            {
                // FIXME: We need to checkout the merged sha as well!
                throw new System.NotImplementedException();
            }

            return(containers);
        }
示例#2
0
 /// <inheritdoc/>
 public IEnumerable <V1Container> GetContainersFor(StepNumber number, ImprovementContext context)
 {
     return(new []   {
         new V1Container {
             Name = "dotnet-package",
             Image = "microsoft/dotnet:2.2-sdk-bionic",
             WorkingDir = "/source/",
             Command = new [] {
                 "/usr/bin/dotnet", "pack",
                 "--no-build",
                 "--packages=/nuget/",
                 "--configuration=Release",
                 "--output=/output/",
                 "--include-symbols",
                 "--include-source",
                 $"-p:PackageVersion={context.Version}"
             },
             VolumeMounts = new []   {
                 new V1VolumeMount {
                     Name = "workdir",
                     SubPath = "source",
                     MountPath = "/source/",
                 },
                 new V1VolumeMount {
                     Name = "workdir",
                     SubPath = "nuget",
                     MountPath = "/nuget/",
                 },
                 new V1VolumeMount {
                     Name = "workdir",
                     SubPath = "output",
                     MountPath = "/output/",
                 },
             },
         },
         new V1Container {
             Name = "move-symbols-nupkg",
             Image = "alpine:3.9",
             WorkingDir = "/output/",
             Command = new [] { "/bin/sh", "-c", "for NUPKG in *.symbols.nupkg; do cp $NUPKG /publish/${NUPKG/.symbols/} ; mv $NUPKG /nuget/${NUPKG/.symbols/} ; done" },
             VolumeMounts = new []   {
                 new V1VolumeMount {
                     Name = "workdir",
                     SubPath = "output",
                     MountPath = "/output/",
                 },
                 new V1VolumeMount {
                     Name = "workdir",
                     SubPath = "publish",
                     MountPath = "/publish/",
                 },
                 new V1VolumeMount {
                     Name = "azure",
                     SubPath = context.GetImprovableSubPath("nuget"),
                     MountPath = "/nuget/",
                 },
             },
         },
         new V1Container {
             Name = "nuget-push",
             Image = "microsoft/dotnet:2.2-sdk-bionic",
             WorkingDir = "/publish/",
             Command = new [] {
                 "/usr/bin/dotnet", "nuget", "push", "./",
                 "--source=https://www.myget.org/F/dolittle/api/v2/package",
                 "--api-key=SECRET_HERE",
             },
             VolumeMounts = new []   {
                 new V1VolumeMount {
                     Name = "workdir",
                     SubPath = "publish",
                     MountPath = "/publish/",
                 },
             },
         },
     });
 }