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 static IEnumerable <JobBase> GetJobs(this ConditionedList <Stage> stages) => stages.SelectMany(s => s.FlattenDefinitions().SelectMany(r => r.Jobs.SelectMany(j => j.FlattenDefinitions())));
public JobDependsOnValidation(ConditionedList <JobBase> jobs) : base() { _jobs = jobs.SelectMany(s => s.FlattenDefinitions()).ToList(); }
public NameValidation(ConditionedList <JobBase> jobs) : this(new[] { jobs.SelectMany(j => j.FlattenDefinitions()).Select(s => s.Name).ToList() }) { }
public StageDependsOnValidation(ConditionedList <Stage> stages) : base() { _stages = stages.SelectMany(s => s.FlattenDefinitions()).ToList(); }