Skip to content

Commit

Permalink
Support —-buildpack flags on GCB (GoogleContainerTools#3606)
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot authored and Miklos Kiss committed Feb 3, 2020
1 parent d9ea6ae commit 1b6fdd6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/skaffold/build/gcb/buildpacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func (b *Builder) buildpackBuildSpec(artifact *latest.BuildpackArtifact, tag str
args = append(args, "--run-image", artifact.RunImage)
}

for _, buildpack := range artifact.Buildpacks {
args = append(args, "--buildpack", buildpack)
}

env, err := misc.EvaluateEnv(artifact.Env)
if err != nil {
return cloudbuild.Build{}, errors.Wrap(err, "unable to evaluate env variables")
Expand Down
14 changes: 14 additions & 0 deletions pkg/skaffold/build/gcb/buildpacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ func TestBuildpackBuildSpec(t *testing.T) {
},
shouldErr: true,
},
{
description: "buildpacks list",
artifact: &latest.BuildpackArtifact{
Builder: "builder",
Buildpacks: []string{"buildpack1", "buildpack2"},
},
expected: cloudbuild.Build{
Steps: []*cloudbuild.BuildStep{{
Name: "pack/image",
Args: []string{"pack", "build", "img", "--builder", "builder", "--buildpack", "buildpack1", "--buildpack", "buildpack2"},
}},
Images: []string{"img"},
},
},
}
for _, test := range tests {
testutil.Run(t, test.description, func(t *testutil.T) {
Expand Down

0 comments on commit 1b6fdd6

Please sign in to comment.