-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext.go
More file actions
138 lines (122 loc) · 3.86 KB
/
context.go
File metadata and controls
138 lines (122 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package conditional
// EntryPoint identifies the server path that is evaluating a conditional.
type EntryPoint string
const (
// EntryPointBuildCondition evaluates a Build::Condition without a step.
EntryPointBuildCondition EntryPoint = "build_condition"
// EntryPointBuildConditionWithStep evaluates a Build::Condition with a step.
EntryPointBuildConditionWithStep EntryPoint = "build_condition_with_step"
// EntryPointBuildNotification evaluates build notification deliverability.
EntryPointBuildNotification EntryPoint = "build_notification"
// EntryPointStepNotification evaluates step notification deliverability.
EntryPointStepNotification EntryPoint = "step_notification"
)
// Context contains the Buildkite values available to a conditional.
type Context struct {
EntryPoint EntryPoint
Build Build
Pipeline Pipeline
Organization Organization
Step *Step
// BuildEnv is build-scoped environment. ProjectEnv is pipeline/project
// environment. Matching Build::PipelineEnvironment, ProjectEnv is applied
// first, then BuildEnv overrides it.
BuildEnv map[string]string
ProjectEnv map[string]string
}
// Build contains build values exposed to conditionals.
type Build struct {
ID *string
State *string
Fixed *bool
BlockedState *string
Source *string
SourceEvent *string
SourceAction *string
Branch *string
Tag *string
Message *string
Commit *string
Number *int
Creator Actor
Author Actor
SCM SCM
PullRequest PullRequest
MergeQueue MergeQueue
TriggeredFrom TriggeredFrom
RebuiltFrom RebuiltFrom
}
// Actor contains server-resolved author or creator values. Email should contain
// the value exposed through the server's build.*.email assignments, including
// organization-preferred creator email resolution when applicable.
type Actor struct {
ID *string
Name *string
Email *string
Teams []string
Verified *bool
}
// Pipeline contains pipeline values exposed to conditionals.
type Pipeline struct {
ID *string
Name *string
Slug *string
DefaultBranch *string
Repository *string
StartedPassing *bool
StartedFailing *bool
NextFinishedBuildExists *bool
UseMergeQueueBaseCommitForGitDiffBase *bool
}
// SCM contains source control author and committer values.
type SCM struct {
AuthorName *string
AuthorEmail *string
CommitterName *string
CommitterEmail *string
}
// PullRequest contains pull request values exposed to conditionals.
type PullRequest struct {
ID *string
BaseBranch *string
Draft *bool
Label *string
Labels []string
Repository *string
RepositoryFork *bool
UsingMergeRefspec *bool
}
// MergeQueue contains merge queue values exposed to conditionals.
type MergeQueue struct {
// Active reports whether this build is a merge queue build. The server uses
// this state to gate BUILDKITE_GIT_DIFF_BASE independently of the base values.
Active bool
BaseBranch *string
BaseCommit *string
}
// TriggeredFrom contains values for the build/job that triggered this build.
type TriggeredFrom struct {
BuildID *string
BuildNumber *int
PipelineSlug *string
JobID *string
}
// RebuiltFrom contains values for the build this build was rebuilt from.
type RebuiltFrom struct {
BuildID *string
BuildNumber *int
}
// Organization contains organization values exposed to conditionals.
type Organization struct {
ID *string
Slug *string
}
// Step contains step values exposed to step-aware conditionals.
type Step struct {
ID *string
Key *string
Type *string
Label *string
State *string
Outcome *string
}