Beispiel #1
0
 /// <summary>
 /// Defines a jobList template parameter
 /// </summary>
 /// <param name="name">Name of the parameter, can be referenced in the template as ${{ parameters.name }}</param>
 /// <param name="defaultValue">Default value; if no default, then the parameter MUST be given by the user at runtime</param>
 protected static Parameter JobListParameter(string name, ConditionedList <JobBase>?defaultValue = null)
 => new JobListParameter(name, null, defaultValue);
Beispiel #2
0
 /// <summary>
 /// Defines a deploymentList template parameter
 /// </summary>
 /// <param name="name">Name of the parameter, can be referenced in the template as ${{ parameters.name }}</param>
 /// <param name="defaultValue">Default value; if no default, then the parameter MUST be given by the user at runtime</param>
 protected static Parameter DeploymentListParameter(string name, ConditionedList <DeploymentJob>?defaultValue = null)
 => new DeploymentListParameter(name, null, defaultValue);
Beispiel #3
0
 /// <summary>
 /// Defines a stageList template parameter
 /// </summary>
 /// <param name="name">Name of the parameter, can be referenced in the template as ${{ parameters.name }}</param>
 /// <param name="defaultValue">Default value; if no default, then the parameter MUST be given by the user at runtime</param>
 protected static TemplateParameter StageListParameter(string name, ConditionedList <Stage>?defaultValue = null)
 => new StageListTemplateParameter(name, defaultValue);
Beispiel #4
0
 /// <summary>
 /// Defines a stepList template parameter
 /// </summary>
 /// <param name="name">Name of the parameter, can be referenced in the template as ${{ parameters.name }}</param>
 /// <param name="defaultValue">Default value; if no default, then the parameter MUST be given by the user at runtime</param>
 protected static Parameter StepListParameter(string name, ConditionedList <Step>?defaultValue = null)
 => new StepListParameter(name, null, defaultValue);
Beispiel #5
0
 public static IEnumerable <Step> GetSteps(this ConditionedList <JobBase> jobs)
 => jobs.SelectMany(j => j
Beispiel #6
0
 public static IEnumerable <JobBase> GetJobs(this ConditionedList <Stage> stages)
 => stages.SelectMany(s => s.FlattenDefinitions().SelectMany(r => r.Jobs.SelectMany(j => j.FlattenDefinitions())));
    private static IReadOnlyCollection <IReadOnlyCollection <string> > GetStageAndBuildNameGroups(ConditionedList <Stage> stages)
    {
        var stageNames = stages
                         .SelectMany(s => s.FlattenDefinitions())
                         .Select(s => s.Name)
                         .ToList();

        // For each stage, get its job names
        var jobNames = stages
                       .SelectMany(s => s.FlattenDefinitions()
                                   .Select(s => s.Jobs.SelectMany(j => j.FlattenDefinitions().Select(k => k.Name)).ToList()));

        return(jobNames.Prepend(stageNames).ToList());
    }
 public NameValidation(ConditionedList <JobBase> jobs)
     : this(new[] { jobs.SelectMany(j => j.FlattenDefinitions()).Select(s => s.Name).ToList() })
 {
 }
 public NameValidation(ConditionedList <Stage> stages)
     : this(GetStageAndBuildNameGroups(stages))
 {
 }
Beispiel #10
0
 public JobDependsOnValidation(ConditionedList <JobBase> jobs)
     : base()
 {
     _jobs = jobs.SelectMany(s => s.FlattenDefinitions()).ToList();
 }
Beispiel #11
0
 public StageDependsOnValidation(ConditionedList <Stage> stages)
     : base()
 {
     _stages = stages.SelectMany(s => s.FlattenDefinitions()).ToList();
 }