Skip to content

Commit

Permalink
Merge pull request #1052 from jabrown85/jab/add-heroku-20-builder
Browse files Browse the repository at this point in the history
Add heroku/buildpacks:20 to suggested builders list
  • Loading branch information
dwillist authored Feb 3, 2021
2 parents 5a0e31f + 5202f26 commit d9cb4e7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 11 deletions.
10 changes: 5 additions & 5 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func testWithoutSpecificBuilderRequirement(
assertOutput := assertions.NewOutputAssertionManager(t, output)
assertOutput.IncludesSuggestedBuildersHeading()
assertOutput.IncludesPrefixedGoogleBuilder()
assertOutput.IncludesPrefixedHerokuBuilder()
assertOutput.IncludesPrefixedHerokuBuilders()
assertOutput.IncludesPrefixedPaketoBuilders()
})
})
Expand Down Expand Up @@ -183,7 +183,7 @@ func testWithoutSpecificBuilderRequirement(

assertOutput := assertions.NewOutputAssertionManager(t, output)
assertOutput.IncludesTrustedBuildersHeading()
assertOutput.IncludesHerokuBuilder()
assertOutput.IncludesHerokuBuilders()
assertOutput.IncludesGoogleBuilder()
assertOutput.IncludesPaketoBuilders()
assert.NotContains(output, "has been deprecated")
Expand Down Expand Up @@ -220,7 +220,7 @@ func testWithoutSpecificBuilderRequirement(

assertOutput := assertions.NewOutputAssertionManager(t, output)
assertOutput.IncludesTrustedBuildersHeading()
assertOutput.IncludesHerokuBuilder()
assertOutput.IncludesHerokuBuilders()
assertOutput.IncludesGoogleBuilder()
assertOutput.IncludesPaketoBuilders()
assert.NotContains(output, "has been deprecated")
Expand Down Expand Up @@ -272,7 +272,7 @@ func testWithoutSpecificBuilderRequirement(

assertOutput := assertions.NewOutputAssertionManager(t, output)
assertOutput.IncludesTrustedBuildersHeading()
assertOutput.IncludesHerokuBuilder()
assertOutput.IncludesHerokuBuilders()
assertOutput.IncludesGoogleBuilder()
assertOutput.IncludesPaketoBuilders()
assertOutput.IncludesDeprecationWarning()
Expand Down Expand Up @@ -631,7 +631,7 @@ func testWithoutSpecificBuilderRequirement(
assertOutput := assertions.NewOutputAssertionManager(t, output)
assertOutput.IncludesMessageToSetDefaultBuilder()
assertOutput.IncludesPrefixedGoogleBuilder()
assertOutput.IncludesPrefixedHerokuBuilder()
assertOutput.IncludesPrefixedHerokuBuilders()
assertOutput.IncludesPrefixedPaketoBuilders()
})
})
Expand Down
15 changes: 10 additions & 5 deletions acceptance/assertions/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,23 @@ func (o OutputAssertionManager) IncludesPrefixedGoogleBuilder() {
o.assert.Matches(o.output, regexp.MustCompile(fmt.Sprintf(`Google:\s+'%s'`, googleBuilder)))
}

const herokuBuilder = "heroku/buildpacks:18"
var herokuBuilders = []string{
"heroku/buildpacks:18",
"heroku/buildpacks:20",
}

func (o OutputAssertionManager) IncludesHerokuBuilder() {
func (o OutputAssertionManager) IncludesHerokuBuilders() {
o.testObject.Helper()

o.assert.Contains(o.output, herokuBuilder)
o.assert.ContainsAll(o.output, herokuBuilders...)
}

func (o OutputAssertionManager) IncludesPrefixedHerokuBuilder() {
func (o OutputAssertionManager) IncludesPrefixedHerokuBuilders() {
o.testObject.Helper()

o.assert.Matches(o.output, regexp.MustCompile(fmt.Sprintf(`Heroku:\s+'%s'`, herokuBuilder)))
for _, builder := range herokuBuilders {
o.assert.Matches(o.output, regexp.MustCompile(fmt.Sprintf(`Heroku:\s+'%s'`, builder)))
}
}

var paketoBuilders = []string{
Expand Down
2 changes: 1 addition & 1 deletion doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func Example_build() {
// randomly select a builder to use from among the following
builderList := []string{
"gcr.io/buildpacks/builder:v1",
"heroku/buildpacks:18",
"heroku/buildpacks:20",
"gcr.io/paketo-buildpacks/builder:base",
}

Expand Down
4 changes: 4 additions & 0 deletions internal/commands/config_trusted_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) {
outBuf,
"gcr.io/buildpacks/builder:v1",
"heroku/buildpacks:18",
"heroku/buildpacks:20",
"paketobuildpacks/builder:base",
"paketobuildpacks/builder:full",
"paketobuildpacks/builder:tiny",
Expand All @@ -73,6 +74,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) {
outBuf,
"gcr.io/buildpacks/builder:v1",
"heroku/buildpacks:18",
"heroku/buildpacks:20",
"paketobuildpacks/builder:base",
"paketobuildpacks/builder:full",
"paketobuildpacks/builder:tiny",
Expand All @@ -93,6 +95,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) {
outBuf,
"gcr.io/buildpacks/builder:v1",
"heroku/buildpacks:18",
"heroku/buildpacks:20",
"paketobuildpacks/builder:base",
"paketobuildpacks/builder:full",
"paketobuildpacks/builder:tiny",
Expand All @@ -109,6 +112,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) {
"gcr.io/buildpacks/builder:v1",
builderName,
"heroku/buildpacks:18",
"heroku/buildpacks:20",
"paketobuildpacks/builder:base",
"paketobuildpacks/builder:full",
"paketobuildpacks/builder:tiny",
Expand Down
1 change: 1 addition & 0 deletions internal/commands/inspect_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ func testInspectBuilderCommand(t *testing.T, when spec.G, it spec.S) {
assert.Matches(outBuf.String(), regexp.MustCompile(`Paketo Buildpacks:\s+'paketobuildpacks/builder:base'`))
assert.Matches(outBuf.String(), regexp.MustCompile(`Paketo Buildpacks:\s+'paketobuildpacks/builder:full'`))
assert.Matches(outBuf.String(), regexp.MustCompile(`Heroku:\s+'heroku/buildpacks:18'`))
assert.Matches(outBuf.String(), regexp.MustCompile(`Heroku:\s+'heroku/buildpacks:20'`))
})
})

Expand Down
2 changes: 2 additions & 0 deletions internal/commands/list_trusted_builders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func testListTrustedBuildersCommand(t *testing.T, when spec.G, it spec.S) {
outBuf,
"gcr.io/buildpacks/builder:v1",
"heroku/buildpacks:18",
"heroku/buildpacks:20",
"paketobuildpacks/builder:base",
"paketobuildpacks/builder:full",
"paketobuildpacks/builder:tiny",
Expand All @@ -89,6 +90,7 @@ func testListTrustedBuildersCommand(t *testing.T, when spec.G, it spec.S) {
"gcr.io/buildpacks/builder:v1",
builderName,
"heroku/buildpacks:18",
"heroku/buildpacks:20",
"paketobuildpacks/builder:base",
"paketobuildpacks/builder:full",
"paketobuildpacks/builder:tiny",
Expand Down
5 changes: 5 additions & 0 deletions internal/commands/suggest_builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ var suggestedBuilders = []SuggestedBuilder{
Image: "heroku/buildpacks:18",
DefaultDescription: "heroku-18 base image with buildpacks for Ruby, Java, Node.js, Python, Golang, & PHP",
},
{
Vendor: "Heroku",
Image: "heroku/buildpacks:20",
DefaultDescription: "heroku-20 base image with buildpacks for Ruby, Java, Node.js, Python, Golang, & PHP",
},
{
Vendor: "Paketo Buildpacks",
Image: "paketobuildpacks/builder:base",
Expand Down

0 comments on commit d9cb4e7

Please sign in to comment.