BlueGit

timfa bluegit

Files

bluegit / internal / ci / model.go

model.go

feat: GitLab-achtige blue-ci-cd.yml
timfa project_87923614_bot_3aff574f6f98414b945a8799374f9092 · pushed by timfa · 3 weeks ago
Failed 17caa14a History
model.go 2.0 KiB Download Raw
1package ci
2
3import "time"
4
5// Pipeline is een geparset blue-ci-cd.yml.
6type Pipeline struct {
7 Stages []string
8 Variables map[string]string
9 Image string
10 Before []string
11 After []string
12 Cache Cache
13 Timeout time.Duration
14 Tags []string
15 Jobs []Job
16 Warnings []Issue
17}
18
19// Job is één containerstap.
20type Job struct {
21 Name string
22 Stage string
23 Image string
24 Before []string
25 Script []string
26 After []string
27 Needs []string
28 Optional []string
29 NeedsSet bool
30 Variables map[string]string
31 Artifacts Artifacts
32 Rules []Rule
33 AllowFailure bool
34 When string
35 Timeout time.Duration
36 Tags []string
37 Cache Cache
38 ResourceGroup string
39 Only []string
40 Except []string
41}
42
43// Artifacts zijn paden die na een geslaagde job bewaard blijven.
44type Artifacts struct {
45 Paths []string
46 ExpireIn time.Duration
47}
48
49// Cache is een map die tussen jobs van één repository gedeeld wordt.
50type Cache struct {
51 Key string
52 Paths []string
53}
54
55// Rule is één voorwaarde. De eerste rule die klopt wint.
56// Zonder rules draait de job, tenzij only of except dat tegenhoudt.
57type Rule struct {
58 If string
59 Changes []string
60 Exists []string
61 When string
62}
63
64// Issue is een fout of een waarschuwing met een regelnummer.
65type Issue struct {
66 Line int
67 Key string
68 Args []any
69 Warning bool
70}
71
72// Eval is de context waarin rules worden beoordeeld.
73// Changed == nil betekent dat de diff onbekend is; changes klopt dan.
74// Files == nil betekent dat de boom onbekend is; exists klopt dan.
75type Eval struct {
76 Env map[string]string
77 Changed []string
78 Files []string
79}
80
81// Ref beschrijft de commit waarvoor voorgedefinieerde variabelen gelden.
82type Ref struct {
83 SHA string
84 FullRef string
85 Name string
86 Kind string
87 Title string
88 DefaultBranch string
89 Source string
90 ProjectPath string
91 ProjectURL string
92 APIURL string
93 PipelineID int64
94}