-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.go
59 lines (48 loc) · 1.67 KB
/
build.go
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
package types
type Build struct {
Spec BuildSpec `json:"spec"`
Status BuildStatus `json:"status,omitempty"`
}
type BuildSpec struct {
Name string `json:"name,omitempty"`
ProjectID string `json:"project_id,omitempty"`
Namespace string `json:"namespace,omitempty"`
GitRepositorySource `json:",inline,omitempty"`
BuildSource `json:",inline,omitempty"`
}
type BuildSource struct {
// directory is the target directory name.
// Must not contain or start with '..'. If '.' is supplied, the volume directory will be the
// git repository. Otherwise, if specified, the volume will contain the git repository in
// the subdirectory with the given name.
// +optional
Directory string `json:"directory,omitempty"`
Builder BuilderType `json:"builder,omitempty"`
ArtifactImage string `json:"image,omitempty"`
ArtifactImageTag string `json:"image_tag,omitempty"`
Duration string `json:"duration,omitempty"`
}
type BuildStatus struct {
Image string `json:"image,omitempty"`
Phase BuildPhase `json:"phase,omitempty"`
}
type BuildPhase string
const (
BuildPhasePending BuildPhase = "Pending"
BuildPhaseRunning BuildPhase = "Running"
BuildPhaseSucceeded BuildPhase = "Succeeded"
BuildPhaseFailed BuildPhase = "Failed"
)
type BuilderType string
const (
BuilderTypeDockerfile BuilderType = "Dockerfile"
BuilderTypeENVD BuilderType = "envd"
)
type GitRepositorySource struct {
// repository is the URL
Repository string `json:"repository"`
Branch string `json:"branch,omitempty"`
// revision is the commit hash for the specified revision.
// +optional
Revision string `json:"revision,omitempty"`
}