-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
structs.go
88 lines (77 loc) · 1.96 KB
/
structs.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
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
package api
// Configuration for a source
type Source struct {
URL string `json:"url"`
Checksum string `json:"checksum"`
Type string `json:"type"`
Commit string `json:"commit"`
Tag string `json:"tag"`
Branch string `json:"branch"`
Packages []string `json:"packages"`
Path string `json:"path"`
}
// Configuration for a recipe
type Recipe struct {
Name string
Id string
Stages []Stage
Path string
ParentPath string
DownloadsPath string
SourcesPath string
PluginPath string
Containerfile string
Finalize []interface{}
}
// Configuration for a stage in the recipe
type Stage struct {
Id string `json:"id"`
Base string `json:"base"`
Copy []Copy `json:"copy"`
Labels map[string]string `json:"labels"`
Env map[string]string `json:"env"`
Adds []Add `json:"adds"`
Args map[string]string `json:"args"`
Runs Run `json:"runs"`
Expose map[string]string `json:"expose"`
Cmd Cmd `json:"cmd"`
Modules []interface{} `json:"modules"`
Entrypoint Entrypoint
}
type PluginType int
const (
BuildPlugin PluginType = iota
FinalizePlugin
)
// Information about a plugin
type PluginInfo struct {
Name string
Type PluginType
UseContainerCmds bool
}
// Configuration for copying files or directories in a stage
type Copy struct {
From string
SrcDst map[string]string
Workdir string
}
// Configuration for adding files or directories in a stage
type Add struct {
SrcDst map[string]string
Workdir string
}
// Configuration for the entrypoint of a container
type Entrypoint struct {
Exec []string
Workdir string
}
// Configuration for a command to run in the container
type Cmd struct {
Exec []string
Workdir string
}
// Configuration for commands to run in the container
type Run struct {
Commands []string
Workdir string
}