Use paketo-buildpacks/builder as default builder

This commit changes the default builder image from
`cloudfoundry/cnb:bionic-platform-api-0.2` to
`gcr.io/paketo-buildpacks/builder:base-platform-api-0.3`. It also
uses a `paketo-buildpacks/builder` image instead of a
`cloudfoundry/cnb` image to test compatibility with lifecycle v2
and uses paketo naming instead of cloudfoundry when mocking builder
interactions.

Some adjustments to lifecycle phases were also made to align more
closely with the pack CLI.

Fixes gh-21066
This commit is contained in:
Scott Frederick
2020-04-29 14:05:05 -05:00
parent 14c88b3c04
commit f3d717e97a
28 changed files with 95 additions and 56 deletions

View File

@@ -61,7 +61,7 @@ class BootBuildImageIntegrationTests {
String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("cloudfoundry/cnb:bionic-platform-api");
assertThat(result.getOutput()).contains("paketo-buildpacks/builder");
ImageReference imageReference = ImageReference.of(ImageName.of(projectName));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
@@ -77,9 +77,9 @@ class BootBuildImageIntegrationTests {
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example.com/test-image-name");
assertThat(result.getOutput()).contains("cloudfoundry/cnb:bionic-platform-api");
ImageReference imageReference = ImageReference.of(ImageName.of("example.com/test-image-name"));
assertThat(result.getOutput()).contains("example/test-image-name");
assertThat(result.getOutput()).contains("paketo-buildpacks/builder");
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-name"));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
}
@@ -93,11 +93,10 @@ class BootBuildImageIntegrationTests {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage");
String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("cloudfoundry/cnb:bionic-platform-api-0.2");
ImageReference imageReference = ImageReference.of(ImageName.of(projectName));
assertThat(result.getOutput()).contains("example/test-image-v2");
assertThat(result.getOutput()).contains("paketo-buildpacks/builder:base-platform-api-0.2");
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-v2"));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
}
@@ -110,12 +109,12 @@ class BootBuildImageIntegrationTests {
void buildsImageWithCommandLineOptions() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example.com/test-image-name",
"--builder=cloudfoundry/cnb:bionic-platform-api-0.2");
BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example/test-image-v2",
"--builder=gcr.io/paketo-buildpacks/builder:base-platform-api-0.2");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example.com/test-image-name");
assertThat(result.getOutput()).contains("cloudfoundry/cnb:bionic-platform-api-0.2");
ImageReference imageReference = ImageReference.of(ImageName.of("example.com/test-image-name"));
assertThat(result.getOutput()).contains("example/test-image-v2");
assertThat(result.getOutput()).contains("paketo-buildpacks/builder:base-platform-api-0.2");
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-v2"));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
}

View File

@@ -174,7 +174,7 @@ class BootBuildImageTests {
@Test
void whenNoBuilderIsConfiguredThenRequestHasDefaultBuilder() {
assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("cloudfoundry/cnb");
assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("paketo-buildpacks/builder");
}
@Test