package ci import "time" // Pipeline is een geparset blue-ci-cd.yml. type Pipeline struct { Stages []string Variables map[string]string Image string Before []string After []string Cache Cache Timeout time.Duration Tags []string Jobs []Job Warnings []Issue } // Job is één containerstap. type Job struct { Name string Stage string Image string Before []string Script []string After []string Needs []string Optional []string NeedsSet bool Variables map[string]string Artifacts Artifacts Rules []Rule AllowFailure bool When string Timeout time.Duration Tags []string Cache Cache ResourceGroup string Only []string Except []string } // Artifacts zijn paden die na een geslaagde job bewaard blijven. type Artifacts struct { Paths []string ExpireIn time.Duration } // Cache is een map die tussen jobs van één repository gedeeld wordt. type Cache struct { Key string Paths []string } // Rule is één voorwaarde. De eerste rule die klopt wint. // Zonder rules draait de job, tenzij only of except dat tegenhoudt. type Rule struct { If string Changes []string Exists []string When string } // Issue is een fout of een waarschuwing met een regelnummer. type Issue struct { Line int Key string Args []any Warning bool } // Eval is de context waarin rules worden beoordeeld. // Changed == nil betekent dat de diff onbekend is; changes klopt dan. // Files == nil betekent dat de boom onbekend is; exists klopt dan. type Eval struct { Env map[string]string Changed []string Files []string } // MRInfo is de merge request waar een pipeline bij hoort. // Leeg betekent een gewone branch- of tag-pipeline. type MRInfo struct { ID int64 IID int64 Title string SourceBranch string TargetBranch string ProjectPath string ProjectURL string TargetSHA string } // Ref beschrijft de commit waarvoor voorgedefinieerde variabelen gelden. type Ref struct { SHA string FullRef string Name string Kind string Title string DefaultBranch string Source string ProjectPath string ProjectURL string APIURL string PipelineID int64 MR *MRInfo }