Skip to content

Commit

Permalink
Use CNB builder for heroku-22 stack
Browse files Browse the repository at this point in the history
refs #5
  • Loading branch information
ipmb committed Oct 30, 2023
1 parent f96edcb commit 0448a77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
25 changes: 16 additions & 9 deletions builder/build/appjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ const DefaultStack = "heroku-20"
var IncludedBuildpacks = map[string][]string{
"heroku-20": {
// $ pack builder inspect heroku/buildpacks:20 -o json | jq '.remote_info.buildpacks[].id'
"heroku/builder-eol-warning",
"heroku/go",
"heroku/gradle",
"heroku/java",
"heroku/java-function",
"heroku/jvm",
"heroku/jvm-function-invoker",
"heroku/maven",
"heroku/nodejs",
"heroku/nodejs-corepack",
"heroku/nodejs-engine",
"heroku/nodejs-function",
"heroku/nodejs-function-invoker",
"heroku/nodejs-npm",
"heroku/nodejs-npm-engine",
"heroku/nodejs-npm-install",
"heroku/nodejs-pnpm-install",
"heroku/nodejs-yarn",
"heroku/php",
"heroku/procfile",
Expand All @@ -53,16 +53,24 @@ var IncludedBuildpacks = map[string][]string{
"heroku/scala",
},
"heroku-22": {
// $ pack builder inspect heroku/builder-classic:22 -o json | jq '.remote_info.buildpacks[].id'
"heroku/clojure",
// $ pack builder inspect heroku/builder:22 -o json | jq '.remote_info.buildpacks[].id'
"heroku/go",
"heroku/gradle",
"heroku/java",
"heroku/jvm",
"heroku/maven",
"heroku/nodejs",
"heroku/nodejs-corepack",
"heroku/nodejs-engine",
"heroku/nodejs-npm-engine",
"heroku/nodejs-npm-install",
"heroku/nodejs-pnpm-install",
"heroku/nodejs-yarn",
"heroku/php",
"heroku/procfile",
"heroku/python",
"heroku/ruby",
"heroku/sbt",
"heroku/scala",
},
}
Expand Down Expand Up @@ -131,9 +139,8 @@ func (a *AppJSON) GetBuilders() []string {
if a.Stack == "heroku-20" {
return []string{"heroku/buildpacks:20", "heroku/heroku:20-cnb"}
}
// TODO: use heroku/builder:22 can be used when all buildpacks are CNB
if a.Stack == "heroku-22" {
return []string{"heroku/builder-classic:22", "heroku/heroku:22-cnb"}
return []string{"heroku/builder:22", "heroku/heroku:22-cnb"}
}
return []string{a.Stack}
}
Expand Down
4 changes: 2 additions & 2 deletions builder/build/appjson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestAppJsonBuilders(t *testing.T) {
Stack: "heroku-22",
ctx: testContext,
}
expected := []string{"heroku/builder-classic:22", "heroku/heroku:22-cnb"}
expected := []string{"heroku/builder:22", "heroku/heroku:22-cnb"}
if !stringSliceEqual(a.GetBuilders(), expected) {
t.Errorf("expected %s, got %s", expected, a.GetBuilders())
}
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestAppJsonToApppackToml(t *testing.T) {
Build: AppPackTomlBuild{
System: "buildpack",
Buildpacks: []string{"urn:cnb:builder:heroku/nodejs", "urn:cnb:builder:heroku/python"},
Builder: "heroku/builder-classic:22",
Builder: "heroku/builder:22",
},
Test: AppPackTomlTest{
Command: "echo test",
Expand Down

0 comments on commit 0448a77

Please sign in to comment.