From 0448a77b58f0601af77779520dfa89ee6df341d4 Mon Sep 17 00:00:00 2001 From: Peter Baumgartner Date: Mon, 30 Oct 2023 15:49:05 +0000 Subject: [PATCH] Use CNB builder for heroku-22 stack refs #5 --- builder/build/appjson.go | 25 ++++++++++++++++--------- builder/build/appjson_test.go | 4 ++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/builder/build/appjson.go b/builder/build/appjson.go index 212a49b..177b957 100644 --- a/builder/build/appjson.go +++ b/builder/build/appjson.go @@ -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", @@ -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", }, } @@ -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} } diff --git a/builder/build/appjson_test.go b/builder/build/appjson_test.go index 7c8de36..416c6f6 100644 --- a/builder/build/appjson_test.go +++ b/builder/build/appjson_test.go @@ -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()) } @@ -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",