Skip to content

Commit

Permalink
Adds support for heroku-22 stack (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Friesen committed Aug 2, 2023
1 parent 498db72 commit b127d78
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions commands/apps_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,13 @@ func appDevPrepareEnvironment(ctx context.Context, ws *workspace.AppDev, cli bui
if ws.Config.CNBBuilderImage != "" {
images = append(images, ws.Config.CNBBuilderImage)
} else {
images = append(images, builder.CNBBuilderImage)
images = append(images, builder.CNBBuilderImage_Heroku18)
images = append(images, builder.CNBBuilderImage_Heroku22)
}

// TODO: get stack run image from builder image md after we pull it, see below
images = append(images, "digitaloceanapps/apps-run:7858f2c")
images = append(images, "digitaloceanapps/apps-run:heroku-18_1b6264d")
images = append(images, "digitaloceanapps/apps-run:heroku-22_1b6264d")
}

if componentSpec.GetType() == godo.AppComponentTypeStaticSite {
Expand Down
10 changes: 8 additions & 2 deletions internal/apps/builder/cnb.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import (

const (
// CNBBuilderImage represents the local cnb builder.
CNBBuilderImage = "digitaloceanapps/cnb-local-builder:v0.58.0"
CNBBuilderImage_Heroku18 = "digitaloceanapps/cnb-local-builder:heroku-18_63b9615"
CNBBuilderImage_Heroku22 = "digitaloceanapps/cnb-local-builder:heroku-22_63b9615"

appVarAllowListKey = "APP_VARS"
appVarPrefix = "APP_VAR_"
Expand Down Expand Up @@ -375,6 +376,11 @@ func (b *CNBComponentBuilder) builderImage() string {
if b.builderImageOverride != "" {
return b.builderImageOverride
}
for _, f := range b.spec.Features {
if strings.EqualFold(f, "buildpack-stack=ubuntu-22") {
return CNBBuilderImage_Heroku22
}
}

return CNBBuilderImage
return CNBBuilderImage_Heroku18
}

0 comments on commit b127d78

Please sign in to comment.