@@ -44,23 +44,23 @@ type BuildStatus string
44
44
45
45
// Valid values for BuildStatus.
46
46
const (
47
- // BuildNew is automatically assigned to a newly created build.
47
+ // BuildStatusNew is automatically assigned to a newly created build.
48
48
BuildStatusNew BuildStatus = "New"
49
49
50
- // BuildPending indicates that a pod name has been assigned and a build is
50
+ // BuildStatusPending indicates that a pod name has been assigned and a build is
51
51
// about to start running.
52
52
BuildStatusPending BuildStatus = "Pending"
53
53
54
- // BuildRunning indicates that a pod has been created and a build is running.
54
+ // BuildStatusRunning indicates that a pod has been created and a build is running.
55
55
BuildStatusRunning BuildStatus = "Running"
56
56
57
- // BuildComplete indicates that a build has been successful.
57
+ // BuildStatusComplete indicates that a build has been successful.
58
58
BuildStatusComplete BuildStatus = "Complete"
59
59
60
- // BuildFailed indicates that a build has executed and failed.
60
+ // BuildStatusFailed indicates that a build has executed and failed.
61
61
BuildStatusFailed BuildStatus = "Failed"
62
62
63
- // BuildError indicates that an error prevented the build from executing.
63
+ // BuildStatusError indicates that an error prevented the build from executing.
64
64
BuildStatusError BuildStatus = "Error"
65
65
66
66
// BuildStatusCancelled indicates that a running/pending build was stopped from executing.
@@ -72,7 +72,7 @@ type BuildSourceType string
72
72
73
73
// Valid values for BuildSourceType.
74
74
const (
75
- //BuildGitSource is a Git SCM
75
+ //BuildSourceGit is a Git SCM
76
76
BuildSourceGit BuildSourceType = "Git"
77
77
)
78
78
@@ -150,6 +150,15 @@ const (
150
150
CustomBuildStrategyType BuildStrategyType = "Custom"
151
151
)
152
152
153
+ const (
154
+ // CustomBuildStrategyBaseImageKey is the environment variable that indicates the base image to be used when
155
+ // performing a custom build, if needed.
156
+ CustomBuildStrategyBaseImageKey = "OPENSHIFT_CUSTOM_BUILD_BASE_IMAGE"
157
+
158
+ // DefaultImageTag is used when an image tag is needed and the configuration
159
+ DefaultImageTag string = "latest"
160
+ )
161
+
153
162
// CustomBuildStrategy defines input parameters specific to Custom build.
154
163
type CustomBuildStrategy struct {
155
164
// Image is the image required to execute the build. If not specified
@@ -175,6 +184,11 @@ type DockerBuildStrategy struct {
175
184
// NoCache if set to true indicates that the docker build must be executed with the
176
185
// --no-cache=true flag
177
186
NoCache bool `json:"noCache,omitempty" yaml:"noCache,omitempty"`
187
+
188
+ // BaseImage is optional and indicates the image that the dockerfile for this
189
+ // build should "FROM". If present, the build process will substitute this value
190
+ // into the FROM line of the dockerfile.
191
+ BaseImage string `json:"baseImage,omitempty" yaml:"baseImage,omitempty"`
178
192
}
179
193
180
194
// STIBuildStrategy defines input parameters specific to an STI build.
@@ -222,6 +236,17 @@ type WebHookTrigger struct {
222
236
Secret string `json:"secret,omitempty" yaml:"secret,omitempty"`
223
237
}
224
238
239
+ // ImageChangeTrigger allows builds to be triggered when an ImageRepository changes
240
+ type ImageChangeTrigger struct {
241
+ // Image is used to specify the value in the BuildConfig to replace with the
242
+ // immutable image id supplied by the ImageRepository when this trigger fires.
243
+ Image string `json:"image" yaml:"image"`
244
+ // ImageRepositoryRef a reference to a Docker image repository to watch for changes.
245
+ ImageRepositoryRef * kapi.ObjectReference `json:"imageRepositoryRef" yaml:"imageRepositoryRef"`
246
+ // Tag is the name of an image repository tag to watch for changes.
247
+ Tag string `json:"tag,omitempty" yaml:"tag,omitempty"`
248
+ }
249
+
225
250
// BuildTriggerPolicy describes a policy for a single trigger that results in a new Build.
226
251
type BuildTriggerPolicy struct {
227
252
// Type is the type of build trigger
@@ -232,6 +257,9 @@ type BuildTriggerPolicy struct {
232
257
233
258
// GenericWebHook contains the parameters for a Generic webhook type of trigger
234
259
GenericWebHook * WebHookTrigger `json:"generic,omitempty" yaml:"generic,omitempty"`
260
+
261
+ // ImageChange contains parameters for an ImageChange type of trigger
262
+ ImageChange * ImageChangeTrigger `json:"imageChange,omitempty" yaml:"imageChange,omitempty"`
235
263
}
236
264
237
265
// BuildTriggerType refers to a specific BuildTriggerPolicy implementation.
@@ -240,11 +268,15 @@ type BuildTriggerType string
240
268
const (
241
269
// GithubWebHookType represents a trigger that launches builds on
242
270
// Github webhook invocations
243
- GithubWebHookType BuildTriggerType = "github"
271
+ GithubWebHookBuildTriggerType BuildTriggerType = "github"
244
272
245
273
// GenericWebHookType represents a trigger that launches builds on
246
274
// generic webhook invocations
247
- GenericWebHookType BuildTriggerType = "generic"
275
+ GenericWebHookBuildTriggerType BuildTriggerType = "generic"
276
+
277
+ // ImageChangeType represents a trigger that launches builds on
278
+ // availability of a new version of an image
279
+ ImageChangeBuildTriggerType BuildTriggerType = "imageChange"
248
280
)
249
281
250
282
// BuildList is a collection of Builds.
0 commit comments