-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
types.go
123 lines (86 loc) · 3.65 KB
/
types.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
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
package api
import docker "github.com/fsouza/go-dockerclient"
// Config contains essential fields for performing build.
type Config struct {
// BuilderImage describes which image is used for building the result images.
BuilderImage string
// DockerConfig describes how to access host docker daemon.
DockerConfig *DockerConfig
// DockerCfgPath provides the path to the .dockercfg file
DockerCfgPath string
// PullAuthentication holds the authentication information for pulling the
// Docker images from private repositories
PullAuthentication docker.AuthConfiguration
// PreserveWorkingDir describes if working directory should be left after processing.
PreserveWorkingDir bool
// Source URL describing the location of sources used to build the result image.
Source string
// Ref is a tag/branch to be used for build.
Ref string
// Tag is a result image tag name.
Tag string
// Incremental describes whether to try to perform incremental build.
Incremental bool
// RemovePreviousImage describes if previous image should be removed after successful build.
// This applies only to incremental builds.
RemovePreviousImage bool
// Environment is a map of environment variables to be passed to the image.
Environment map[string]string
// EnvironmentFile provides the path to a file with list of environment
// variables.
EnvironmentFile string
// CallbackURL is a URL which is called upon successful build to inform about that fact.
CallbackURL string
// ScriptsURL is a URL describing the localization of STI scripts used during build process.
ScriptsURL string
// Destination specifies a location where the untar operation will place its artifacts.
Destination string
// ForcePull describes if the builder should pull the images from registry prior to building.
ForcePull bool
// WorkingDir describes temporary directory used for downloading sources, scripts and tar operations.
WorkingDir string
// LayeredBuild describes if this is build which layered scripts and sources on top of BuilderImage.
LayeredBuild bool
// Operate quietly. Progress and assemble script output are not reported, only fatal errors.
// (default: false).
Quiet bool
// Specify a relative directory inside the application repository that should
// be used as a root directory for the application.
ContextDir string
}
// DockerConfig contains the configuration for a Docker connection
type DockerConfig struct {
// Endpoint is the docker network endpoint or socket
Endpoint string
// CertFile is the certificate file path for a TLS connection
CertFile string
// KeyFile is the key file path for a TLS connection
KeyFile string
// CAFile is the certificate authority file path for a TLS connection
CAFile string
}
// Result structure contains information from build process.
type Result struct {
// Success describes whether the build was successful.
Success bool
// Messages is a list of messages from build process.
Messages []string
// WorkingDir describes temporary directory used for downloading sources, scripts and tar operations.
WorkingDir string
// ImageID describes resulting image ID.
ImageID string
}
// InstallResult structure describes the result of install operation
type InstallResult struct {
// Script describes which script this result refers to
Script string
// URL describes from where the script was taken
URL string
// Downloaded describes if download operation happened, this will be true for
// external scripts, but false for scripts from inside the image
Downloaded bool
// Installed describes if script was installed to upload directory
Installed bool
// Error describes last error encountered during install operation
Error error
}