Skip to content

Commit

Permalink
Support disk size and machine type for GCB
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <david@gageot.net>
  • Loading branch information
dgageot committed Jul 11, 2018
1 parent a143d38 commit eccf398
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/annotated-skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,8 @@ profiles:
- name: gcb
build:
googleCloudBuild:
projectId: k8s-skaffold
# Google Cloud Build's project id
projectId: k8s-skaffold
# diskSizeGb: 200
# machineType: "N1_HIGHCPU_8"|"N1_HIGHCPU_32"

4 changes: 4 additions & 0 deletions pkg/skaffold/build/container_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ func (cb *GoogleCloudBuilder) buildArtifact(ctx context.Context, out io.Writer,
},
},
Images: []string{artifact.ImageName},
Options: &cloudbuild.BuildOptions{
DiskSizeGb: cb.DiskSizeGb,
MachineType: cb.MachineType,
},
})
op, err := call.Context(ctx).Do()
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion pkg/skaffold/schema/v1alpha2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ type LocalBuild struct {
// GoogleCloudBuild contains the fields needed to do a remote build on
// Google Container Builder.
type GoogleCloudBuild struct {
ProjectID string `yaml:"projectId"`
ProjectID string `yaml:"projectId"`
DiskSizeGb int64 `yaml:"diskSizeGb,omitempty"`
MachineType string `yaml:"machineType,omitempty"`
}

// KanikoBuild contains the fields needed to do a on-cluster build using
Expand Down

0 comments on commit eccf398

Please sign in to comment.