Skip to content

Commit e22db83

Browse files
committed
Initial API draft for serial builds
1 parent 3860072 commit e22db83

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

pkg/build/api/types.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ type BuildStatus struct {
8686
// Cancelled describes if a cancel event was triggered for the build.
8787
Cancelled bool
8888

89+
// Skipped indicates that this build was marked as skipped. The build will be
90+
// cancelled, but this field is used to set the appropriate reason.
91+
Skipped bool
92+
8993
// Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.
9094
Reason StatusReason
9195

@@ -177,6 +181,9 @@ const (
177181
// StatusReasonExceededRetryTimeout is an error condition when the build has
178182
// not completed and retrying the build times out.
179183
StatusReasonExceededRetryTimeout = "ExceededRetryTimeout"
184+
185+
// StatusReasonSkipped indicates that the build was skipped.
186+
StatusReasonSkipped = "Skipped"
180187
)
181188

182189
// BuildSource is the input used for the build.
@@ -559,10 +566,30 @@ type BuildConfigSpec struct {
559566
// are defined, a new build can only occur as a result of an explicit client build creation.
560567
Triggers []BuildTriggerPolicy
561568

569+
// SchedulePolicy describes how the new build created from this build
570+
// configuration will be scheduled for execution.
571+
// This is optional, if not specified we default to "parallel".
572+
SchedulePolicy *BuildSchedulePolicy
573+
562574
// BuildSpec is the desired build specification
563575
BuildSpec
564576
}
565577

578+
// BuildSchedulePolicy defines the behaviour of how the new builds are executed
579+
// from the existing build configuration.
580+
type BuildSchedulePolicy string
581+
582+
const (
583+
// BuildSchedulePolicyParallel schedules new builds immediately after they are
584+
// created. Builds will be executed in parallel. This is the default policy.
585+
BuildSchedulePolicyParallel BuildSchedulePolicy = "parallel"
586+
587+
// BuildSchedulePolicySerial schedules new builds to execute in a sequence as
588+
// they are created. Every build gets queued up and will execute when the
589+
// previous build completes.
590+
BuildSchedulePolicySerial BuildSchedulePolicy = "serial"
591+
)
592+
566593
// BuildConfigStatus contains current state of the build config object.
567594
type BuildConfigStatus struct {
568595
// LastVersion is used to inform about number of last triggered build.

0 commit comments

Comments
 (0)