Skip to content

Commit

Permalink
Enable kyma alpha app push cache (#2278)
Browse files Browse the repository at this point in the history
  • Loading branch information
pPrecel authored Dec 10, 2024
1 parent 28e74e0 commit 18d6e3a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/pack/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"

"github.com/buildpacks/pack/pkg/cache"
"github.com/buildpacks/pack/pkg/client"
"github.com/buildpacks/pack/pkg/logging"
"github.com/pkg/errors"
Expand All @@ -16,11 +17,27 @@ func Build(ctx context.Context, appName, appPath string) error {
return errors.Wrap(err, "failed to create buildpack client")
}

tmpDir := os.TempDir()

err = pack.Build(ctx, client.BuildOptions{
Image: appName,
AppPath: appPath,
Platform: "linux/amd64",
Builder: "paketobuildpacks/builder-jammy-base",
Cache: cache.CacheOpts{
Build: cache.CacheInfo{
Format: cache.CacheBind,
Source: fmt.Sprintf("%s/kyma-cache/app-push/build", tmpDir),
},
Launch: cache.CacheInfo{
Format: cache.CacheBind,
Source: fmt.Sprintf("%s/kyma-cache/app-push/launch", tmpDir),
},
Kaniko: cache.CacheInfo{
Format: cache.CacheBind,
Source: fmt.Sprintf("%s/kyma-cache/app-push/kaniko", tmpDir),
},
},
})
if err != nil {
return errors.Wrap(err, fmt.Sprintf("failed to build %s app from the %s dir", appName, appPath))
Expand Down

0 comments on commit 18d6e3a

Please sign in to comment.