Skip to content

Commit 553cc2e

Browse files
dgageotMiklos Kiss
authored and
Miklos Kiss
committed
Support —-buildpack flags on GCB (GoogleContainerTools#3606)
Signed-off-by: David Gageot <[email protected]>
1 parent b58069c commit 553cc2e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

pkg/skaffold/build/gcb/buildpacks.go

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ func (b *Builder) buildpackBuildSpec(artifact *latest.BuildpackArtifact, tag str
3131
args = append(args, "--run-image", artifact.RunImage)
3232
}
3333

34+
for _, buildpack := range artifact.Buildpacks {
35+
args = append(args, "--buildpack", buildpack)
36+
}
37+
3438
env, err := misc.EvaluateEnv(artifact.Env)
3539
if err != nil {
3640
return cloudbuild.Build{}, errors.Wrap(err, "unable to evaluate env variables")

pkg/skaffold/build/gcb/buildpacks_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ func TestBuildpackBuildSpec(t *testing.T) {
8282
},
8383
shouldErr: true,
8484
},
85+
{
86+
description: "buildpacks list",
87+
artifact: &latest.BuildpackArtifact{
88+
Builder: "builder",
89+
Buildpacks: []string{"buildpack1", "buildpack2"},
90+
},
91+
expected: cloudbuild.Build{
92+
Steps: []*cloudbuild.BuildStep{{
93+
Name: "pack/image",
94+
Args: []string{"pack", "build", "img", "--builder", "builder", "--buildpack", "buildpack1", "--buildpack", "buildpack2"},
95+
}},
96+
Images: []string{"img"},
97+
},
98+
},
8599
}
86100
for _, test := range tests {
87101
testutil.Run(t, test.description, func(t *testutil.T) {

0 commit comments

Comments
 (0)