Merge pull request #23628 from ekcasey

* gh-23628:
  Polish "Update default builder image"
  Update default builder image

Closes gh-23628
pull/23694/head
Scott Frederick 4 years ago
commit 70dcd3d5e1

@ -37,7 +37,7 @@ import org.springframework.util.Assert;
*/ */
public class BuildRequest { public class BuildRequest {
static final String DEFAULT_BUILDER_IMAGE_NAME = "gcr.io/paketo-buildpacks/builder:base-platform-api-0.3"; static final String DEFAULT_BUILDER_IMAGE_NAME = "paketobuildpacks/builder:base";
private static final ImageReference DEFAULT_BUILDER = ImageReference.of(DEFAULT_BUILDER_IMAGE_NAME); private static final ImageReference DEFAULT_BUILDER = ImageReference.of(DEFAULT_BUILDER_IMAGE_NAME);

@ -55,7 +55,7 @@ public class BuildRequestTests {
writeTestJarFile(jarFile); writeTestJarFile(jarFile);
BuildRequest request = BuildRequest.forJarFile(jarFile); BuildRequest request = BuildRequest.forJarFile(jarFile);
assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1"); assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1");
assertThat(request.getBuilder().toString()).isEqualTo(BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); assertThat(request.getBuilder().toString()).isEqualTo("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME);
assertThat(request.getApplicationContent(Owner.ROOT)).satisfies(this::hasExpectedJarContent); assertThat(request.getApplicationContent(Owner.ROOT)).satisfies(this::hasExpectedJarContent);
assertThat(request.getEnv()).isEmpty(); assertThat(request.getEnv()).isEmpty();
} }
@ -66,7 +66,7 @@ public class BuildRequestTests {
writeTestJarFile(jarFile); writeTestJarFile(jarFile);
BuildRequest request = BuildRequest.forJarFile(ImageReference.of("test-app"), jarFile); BuildRequest request = BuildRequest.forJarFile(ImageReference.of("test-app"), jarFile);
assertThat(request.getName().toString()).isEqualTo("docker.io/library/test-app:latest"); assertThat(request.getName().toString()).isEqualTo("docker.io/library/test-app:latest");
assertThat(request.getBuilder().toString()).isEqualTo(BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); assertThat(request.getBuilder().toString()).isEqualTo("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME);
assertThat(request.getApplicationContent(Owner.ROOT)).satisfies(this::hasExpectedJarContent); assertThat(request.getApplicationContent(Owner.ROOT)).satisfies(this::hasExpectedJarContent);
assertThat(request.getEnv()).isEmpty(); assertThat(request.getEnv()).isEmpty();
} }

@ -105,7 +105,7 @@ The following table summarizes the available properties and their default values
| `builder` | `builder`
| `--builder` | `--builder`
| Name of the Builder image to use. | Name of the Builder image to use.
| `gcr.io/paketo-buildpacks/builder:base-platform-api-0.3` | `paketobuildpacks/builder:base`
| `runImage` | `runImage`
| `--runImage` | `--runImage`

@ -60,7 +60,7 @@ class BootBuildImageIntegrationTests {
String projectName = this.gradleBuild.getProjectDir().getName(); String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName); assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("paketo-buildpacks/builder"); assertThat(result.getOutput()).contains("paketobuildpacks/builder");
ImageReference imageReference = ImageReference.of(ImageName.of(projectName)); ImageReference imageReference = ImageReference.of(ImageName.of(projectName));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) { try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
@ -77,7 +77,7 @@ class BootBuildImageIntegrationTests {
BuildResult result = this.gradleBuild.build("bootBuildImage"); BuildResult result = this.gradleBuild.build("bootBuildImage");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example/test-image-name"); assertThat(result.getOutput()).contains("example/test-image-name");
assertThat(result.getOutput()).contains("paketo-buildpacks/builder"); assertThat(result.getOutput()).contains("paketobuildpacks/builder");
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-name")); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-name"));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) { try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
@ -94,8 +94,8 @@ class BootBuildImageIntegrationTests {
BuildResult result = this.gradleBuild.build("bootBuildImage"); BuildResult result = this.gradleBuild.build("bootBuildImage");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example/test-image-custom"); assertThat(result.getOutput()).contains("example/test-image-custom");
assertThat(result.getOutput()).contains("paketo-buildpacks/builder:full-cf-platform-api-0.3"); assertThat(result.getOutput()).contains("paketobuildpacks/builder:full");
assertThat(result.getOutput()).contains("paketo-buildpacks/run:full-cnb-cf"); assertThat(result.getOutput()).contains("paketobuildpacks/run:full");
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-custom")); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-custom"));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) { try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
@ -110,12 +110,11 @@ class BootBuildImageIntegrationTests {
writeMainClass(); writeMainClass();
writeLongNameResource(); writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example/test-image-cmd", BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example/test-image-cmd",
"--builder=gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3", "--builder=paketobuildpacks/builder:full", "--runImage=paketobuildpacks/run:full-cnb");
"--runImage=gcr.io/paketo-buildpacks/run:full-cnb-cf");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example/test-image-cmd"); assertThat(result.getOutput()).contains("example/test-image-cmd");
assertThat(result.getOutput()).contains("paketo-buildpacks/builder:full-cf-platform-api-0.3"); assertThat(result.getOutput()).contains("paketobuildpacks/builder:full");
assertThat(result.getOutput()).contains("paketo-buildpacks/run:full-cnb-cf"); assertThat(result.getOutput()).contains("paketobuildpacks/run:full");
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-cmd")); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-cmd"));
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) { try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();

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

@ -8,6 +8,6 @@ targetCompatibility = '1.8'
bootBuildImage { bootBuildImage {
imageName = "example/test-image-custom" imageName = "example/test-image-custom"
builder = "gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3" builder = "paketobuildpacks/builder:full"
runImage = "gcr.io/paketo-buildpacks/run:full-cnb-cf" runImage = "paketobuildpacks/run:full-cnb"
} }

@ -128,7 +128,7 @@ The following table summarizes the available parameters and their default values
| `builder` | `builder`
| Name of the Builder image to use. | Name of the Builder image to use.
| `spring-boot.build-image.builder` | `spring-boot.build-image.builder`
| `gcr.io/paketo-buildpacks/builder:base-platform-api-0.3` | `paketobuildpacks/builder:base`
| `runImage` | `runImage`
| Name of the run image to use. | Name of the run image to use.

@ -52,7 +52,7 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
assertThat(jar).isFile(); assertThat(jar).isFile();
File original = new File(project, "target/build-image-0.0.1.BUILD-SNAPSHOT.jar.original"); File original = new File(project, "target/build-image-0.0.1.BUILD-SNAPSHOT.jar.original");
assertThat(original).doesNotExist(); assertThat(original).doesNotExist();
assertThat(buildLog(project)).contains("Building image").contains("paketo-buildpacks/builder") assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder")
.contains("docker.io/library/build-image:0.0.1.BUILD-SNAPSHOT") .contains("docker.io/library/build-image:0.0.1.BUILD-SNAPSHOT")
.contains("Successfully built image"); .contains("Successfully built image");
ImageReference imageReference = ImageReference.of(ImageName.of("build-image"), "0.0.1.BUILD-SNAPSHOT"); ImageReference imageReference = ImageReference.of(ImageName.of("build-image"), "0.0.1.BUILD-SNAPSHOT");
@ -93,14 +93,12 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
void whenBuildImageIsInvokedWithCommandLineParameters(MavenBuild mavenBuild) { void whenBuildImageIsInvokedWithCommandLineParameters(MavenBuild mavenBuild) {
mavenBuild.project("build-image").goals("package") mavenBuild.project("build-image").goals("package")
.systemProperty("spring-boot.build-image.imageName", "example.com/test/cmd-property-name:v1") .systemProperty("spring-boot.build-image.imageName", "example.com/test/cmd-property-name:v1")
.systemProperty("spring-boot.build-image.builder", .systemProperty("spring-boot.build-image.builder", "paketobuildpacks/builder:full")
"gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3") .systemProperty("spring-boot.build-image.runImage", "paketobuildpacks/run:full-cnb")
.systemProperty("spring-boot.build-image.runImage", "gcr.io/paketo-buildpacks/run:full-cnb-cf")
.execute((project) -> { .execute((project) -> {
assertThat(buildLog(project)).contains("Building image") assertThat(buildLog(project)).contains("Building image")
.contains("example.com/test/cmd-property-name:v1") .contains("example.com/test/cmd-property-name:v1").contains("paketobuildpacks/builder:full")
.contains("paketo-buildpacks/builder:full-cf-platform-api-0.3") .contains("paketobuildpacks/run:full").contains("Successfully built image");
.contains("paketo-buildpacks/run:full-cnb-cf").contains("Successfully built image");
ImageReference imageReference = ImageReference.of("example.com/test/cmd-property-name:v1"); ImageReference imageReference = ImageReference.of("example.com/test/cmd-property-name:v1");
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) { try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
@ -114,9 +112,8 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
@TestTemplate @TestTemplate
void whenBuildImageIsInvokedWithCustomBuilderImageAndRunImage(MavenBuild mavenBuild) { void whenBuildImageIsInvokedWithCustomBuilderImageAndRunImage(MavenBuild mavenBuild) {
mavenBuild.project("build-image-custom-builder").goals("package").execute((project) -> { mavenBuild.project("build-image-custom-builder").goals("package").execute((project) -> {
assertThat(buildLog(project)).contains("Building image") assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder:full")
.contains("paketo-buildpacks/builder:full-cf-platform-api-0.3") .contains("paketobuildpacks/run:full")
.contains("paketo-buildpacks/run:full-cnb-cf")
.contains("docker.io/library/build-image-v2-builder:0.0.1.BUILD-SNAPSHOT") .contains("docker.io/library/build-image-v2-builder:0.0.1.BUILD-SNAPSHOT")
.contains("Successfully built image"); .contains("Successfully built image");
ImageReference imageReference = ImageReference ImageReference imageReference = ImageReference
@ -134,7 +131,7 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
void whenBuildImageIsInvokedWithEmptyEnvEntry(MavenBuild mavenBuild) { void whenBuildImageIsInvokedWithEmptyEnvEntry(MavenBuild mavenBuild) {
mavenBuild.project("build-image-empty-env-entry").goals("package").prepare(this::writeLongNameResource) mavenBuild.project("build-image-empty-env-entry").goals("package").prepare(this::writeLongNameResource)
.execute((project) -> { .execute((project) -> {
assertThat(buildLog(project)).contains("Building image").contains("paketo-buildpacks/builder") assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder")
.contains("docker.io/library/build-image-empty-env-entry:0.0.1.BUILD-SNAPSHOT") .contains("docker.io/library/build-image-empty-env-entry:0.0.1.BUILD-SNAPSHOT")
.contains("Successfully built image"); .contains("Successfully built image");
ImageReference imageReference = ImageReference.of(ImageName.of("build-image-empty-env-entry"), ImageReference imageReference = ImageReference.of(ImageName.of("build-image-empty-env-entry"),

@ -23,8 +23,8 @@
</goals> </goals>
<configuration> <configuration>
<image> <image>
<builder>gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3</builder> <builder>paketobuildpacks/builder:full</builder>
<runImage>gcr.io/paketo-buildpacks/run:full-cnb-cf</runImage> <runImage>paketobuildpacks/run:full-cnb</runImage>
</image> </image>
</configuration> </configuration>
</execution> </execution>

@ -59,7 +59,7 @@ class ImageTests {
void getBuildRequestWhenNoCustomizationsUsesDefaults() { void getBuildRequestWhenNoCustomizationsUsesDefaults() {
BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent()); BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT"); assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT");
assertThat(request.getBuilder().toString()).contains("paketo-buildpacks/builder"); assertThat(request.getBuilder().toString()).contains("paketobuildpacks/builder");
assertThat(request.getRunImage()).isNull(); assertThat(request.getRunImage()).isNull();
assertThat(request.getEnv()).isEmpty(); assertThat(request.getEnv()).isEmpty();
assertThat(request.isCleanCache()).isFalse(); assertThat(request.isCleanCache()).isFalse();

Loading…
Cancel
Save