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

@ -29,6 +29,7 @@ import org.springframework.boot.buildpack.platform.docker.type.VolumeName;
* Base class for {@link BuildLog} implementations. * Base class for {@link BuildLog} implementations.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Scott Frederick
* @since 2.3.0 * @since 2.3.0
*/ */
public abstract class AbstractBuildLog implements BuildLog { public abstract class AbstractBuildLog implements BuildLog {
@ -73,6 +74,13 @@ public abstract class AbstractBuildLog implements BuildLog {
return (event) -> log(prefix + event); return (event) -> log(prefix + event);
} }
@Override
public void skippingPhase(String name, String reason) {
log();
log(" > Skipping " + name + " " + reason);
log();
}
@Override @Override
public void executedLifecycle(BuildRequest request) { public void executedLifecycle(BuildRequest request) {
log(); log();

View File

@ -29,6 +29,7 @@ import org.springframework.boot.buildpack.platform.docker.type.VolumeName;
* Callback interface used to provide {@link Builder} output logging. * Callback interface used to provide {@link Builder} output logging.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Scott Frederick
* @since 2.3.0 * @since 2.3.0
* @see #toSystemOut() * @see #toSystemOut()
*/ */
@ -86,6 +87,13 @@ public interface BuildLog {
*/ */
Consumer<LogUpdateEvent> runningPhase(BuildRequest request, String name); Consumer<LogUpdateEvent> runningPhase(BuildRequest request, String name);
/**
* Log that a specific phase is being skipped.
* @param name the name of the phase
* @param reason the reason the phase is skipped
*/
void skippingPhase(String name, String reason);
/** /**
* Log that the lifecycle has executed. * Log that the lifecycle has executed.
* @param request the build request * @param request the build request

View File

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

View File

@ -36,6 +36,7 @@ import org.springframework.util.Assert;
* application. * application.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Scott Frederick
*/ */
class Lifecycle implements Closeable { class Lifecycle implements Closeable {
@ -116,7 +117,12 @@ class Lifecycle implements Closeable {
} }
run(detectPhase()); run(detectPhase());
run(analyzePhase()); run(analyzePhase());
if (this.request.isCleanCache()) {
this.log.skippingPhase("restorer", "due to cleaning cache");
}
else {
run(restorePhase()); run(restorePhase());
}
run(buildPhase()); run(buildPhase());
run(exportPhase()); run(exportPhase());
this.log.executedLifecycle(this.request); this.log.executedLifecycle(this.request);
@ -144,12 +150,14 @@ class Lifecycle implements Closeable {
Phase phase = createPhase("analyzer"); Phase phase = createPhase("analyzer");
phase.withDaemonAccess(); phase.withDaemonAccess();
phase.withLogLevelArg(); phase.withLogLevelArg();
phase.withArgs("-daemon");
if (this.request.isCleanCache()) { if (this.request.isCleanCache()) {
phase.withArgs("-skip-layers"); phase.withArgs("-skip-layers");
} }
phase.withArgs("-daemon"); else {
phase.withArgs("-layers", Directory.LAYERS);
phase.withArgs("-cache-dir", Directory.CACHE); phase.withArgs("-cache-dir", Directory.CACHE);
}
phase.withArgs("-layers", Directory.LAYERS);
phase.withArgs(this.request.getName()); phase.withArgs(this.request.getName());
phase.withBinds(this.buildCacheVolume, Directory.CACHE); phase.withBinds(this.buildCacheVolume, Directory.CACHE);
return phase; return phase;

View File

@ -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("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); assertThat(request.getBuilder().toString()).isEqualTo(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("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME); assertThat(request.getBuilder().toString()).isEqualTo(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();
} }

View File

@ -72,7 +72,7 @@ class BuilderTests {
DockerApi docker = mockDockerApi(); DockerApi docker = mockDockerApi();
Image builderImage = loadImage("image.json"); Image builderImage = loadImage("image.json");
Image runImage = loadImage("run-image.json"); Image runImage = loadImage("run-image.json");
given(docker.image().pull(eq(ImageReference.of("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME)), any())) given(docker.image().pull(eq(ImageReference.of(BuildRequest.DEFAULT_BUILDER_IMAGE_NAME)), any()))
.willAnswer(withPulledImage(builderImage)); .willAnswer(withPulledImage(builderImage));
given(docker.image().pull(eq(ImageReference.of("docker.io/cloudfoundry/run:base-cnb")), any())) given(docker.image().pull(eq(ImageReference.of("docker.io/cloudfoundry/run:base-cnb")), any()))
.willAnswer(withPulledImage(runImage)); .willAnswer(withPulledImage(runImage));
@ -96,7 +96,7 @@ class BuilderTests {
DockerApi docker = mockDockerApi(); DockerApi docker = mockDockerApi();
Image builderImage = loadImage("image.json"); Image builderImage = loadImage("image.json");
Image runImage = loadImage("run-image-with-bad-stack.json"); Image runImage = loadImage("run-image-with-bad-stack.json");
given(docker.image().pull(eq(ImageReference.of("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME)), any())) given(docker.image().pull(eq(ImageReference.of(BuildRequest.DEFAULT_BUILDER_IMAGE_NAME)), any()))
.willAnswer(withPulledImage(builderImage)); .willAnswer(withPulledImage(builderImage));
given(docker.image().pull(eq(ImageReference.of("docker.io/cloudfoundry/run:base-cnb")), any())) given(docker.image().pull(eq(ImageReference.of("docker.io/cloudfoundry/run:base-cnb")), any()))
.willAnswer(withPulledImage(runImage)); .willAnswer(withPulledImage(runImage));
@ -112,7 +112,7 @@ class BuilderTests {
DockerApi docker = mockDockerApiLifecycleError(); DockerApi docker = mockDockerApiLifecycleError();
Image builderImage = loadImage("image.json"); Image builderImage = loadImage("image.json");
Image runImage = loadImage("run-image.json"); Image runImage = loadImage("run-image.json");
given(docker.image().pull(eq(ImageReference.of("docker.io/" + BuildRequest.DEFAULT_BUILDER_IMAGE_NAME)), any())) given(docker.image().pull(eq(ImageReference.of(BuildRequest.DEFAULT_BUILDER_IMAGE_NAME)), any()))
.willAnswer(withPulledImage(builderImage)); .willAnswer(withPulledImage(builderImage));
given(docker.image().pull(eq(ImageReference.of("docker.io/cloudfoundry/run:base-cnb")), any())) given(docker.image().pull(eq(ImageReference.of("docker.io/cloudfoundry/run:base-cnb")), any()))
.willAnswer(withPulledImage(runImage)); .willAnswer(withPulledImage(runImage));

View File

@ -128,6 +128,11 @@ class LifecycleTests {
given(this.docker.container().wait(any())).willReturn(ContainerStatus.of(0, null)); given(this.docker.container().wait(any())).willReturn(ContainerStatus.of(0, null));
BuildRequest request = getTestRequest().withCleanCache(true); BuildRequest request = getTestRequest().withCleanCache(true);
createLifecycle(request).execute(); createLifecycle(request).execute();
assertPhaseWasRun("detector", withExpectedConfig("lifecycle-detector.json"));
assertPhaseWasRun("analyzer", withExpectedConfig("lifecycle-analyzer-clean-cache.json"));
assertPhaseWasNotRun("restorer");
assertPhaseWasRun("builder", withExpectedConfig("lifecycle-builder.json"));
assertPhaseWasRun("exporter", withExpectedConfig("lifecycle-exporter.json"));
VolumeName name = VolumeName.of("pack-cache-b35197ac41ea.build"); VolumeName name = VolumeName.of("pack-cache-b35197ac41ea.build");
verify(this.docker.volume()).delete(name, true); verify(this.docker.volume()).delete(name, true);
} }
@ -201,6 +206,11 @@ class LifecycleTests {
configConsumer.accept(this.configs.get(containerReference.toString())); configConsumer.accept(this.configs.get(containerReference.toString()));
} }
private void assertPhaseWasNotRun(String name) {
ContainerReference containerReference = ContainerReference.of("lifecycle-" + name);
assertThat(this.configs.get(containerReference.toString())).isNull();
}
private IOConsumer<ContainerConfig> withExpectedConfig(String name) { private IOConsumer<ContainerConfig> withExpectedConfig(String name) {
return (config) -> { return (config) -> {
InputStream in = getClass().getResourceAsStream(name); InputStream in = getClass().getResourceAsStream(name);

View File

@ -35,7 +35,7 @@ class DockerApiIntegrationTests {
@Test @Test
void pullImage() throws IOException { void pullImage() throws IOException {
this.docker.image().pull(ImageReference.of("cloudfoundry/cnb:bionic"), this.docker.image().pull(ImageReference.of("gcr.io/paketo-buildpacks/builder:base"),
new TotalProgressPullListener(new TotalProgressBar("Pulling: "))); new TotalProgressPullListener(new TotalProgressBar("Pulling: ")));
} }

View File

@ -145,10 +145,10 @@ class DockerApiTests {
@Test @Test
void pullPullsImageAndProducesEvents() throws Exception { void pullPullsImageAndProducesEvents() throws Exception {
ImageReference reference = ImageReference.of("cloudfoundry/cnb:bionic"); ImageReference reference = ImageReference.of("gcr.io/paketo-buildpacks/builder:base");
URI createUri = new URI(IMAGES_URL + "/create?fromImage=docker.io%2Fcloudfoundry%2Fcnb%3Abionic"); URI createUri = new URI(IMAGES_URL + "/create?fromImage=gcr.io%2Fpaketo-buildpacks%2Fbuilder%3Abase");
String imageHash = "4acb6bfd6c4f0cabaf7f3690e444afe51f1c7de54d51da7e63fac709c56f1c30"; String imageHash = "4acb6bfd6c4f0cabaf7f3690e444afe51f1c7de54d51da7e63fac709c56f1c30";
URI imageUri = new URI(IMAGES_URL + "/docker.io/cloudfoundry/cnb@sha256:" + imageHash + "/json"); URI imageUri = new URI(IMAGES_URL + "/gcr.io/paketo-buildpacks/builder@sha256:" + imageHash + "/json");
given(http().post(createUri)).willReturn(responseOf("pull-stream.json")); given(http().post(createUri)).willReturn(responseOf("pull-stream.json"));
given(http().get(imageUri)).willReturn(responseOf("type/image.json")); given(http().get(imageUri)).willReturn(responseOf("type/image.json"));
Image image = this.api.pull(reference, this.pullListener); Image image = this.api.pull(reference, this.pullListener);

View File

@ -45,7 +45,7 @@ class PullUpdateEventTests extends AbstractJsonTests {
PullImageUpdateEvent event = getObjectMapper().readValue(getContent("pull-update-minimal.json"), PullImageUpdateEvent event = getObjectMapper().readValue(getContent("pull-update-minimal.json"),
PullImageUpdateEvent.class); PullImageUpdateEvent.class);
assertThat(event.getId()).isNull(); assertThat(event.getId()).isNull();
assertThat(event.getStatus()).isEqualTo("Status: Downloaded newer image for cloudfoundry/cnb:bionic"); assertThat(event.getStatus()).isEqualTo("Status: Downloaded newer image for packeto-buildpacks/cnb:base");
assertThat(event.getProgressDetail()).isNull(); assertThat(event.getProgressDetail()).isNull();
assertThat(event.getProgress()).isNull(); assertThat(event.getProgress()).isNull();
} }

View File

@ -29,6 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link JsonStream}. * Tests for {@link JsonStream}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Scott Frederick
*/ */
class JsonStreamTests extends AbstractJsonTests { class JsonStreamTests extends AbstractJsonTests {
@ -43,7 +44,8 @@ class JsonStreamTests extends AbstractJsonTests {
List<ObjectNode> result = new ArrayList<>(); List<ObjectNode> result = new ArrayList<>();
this.jsonStream.get(getContent("stream.json"), result::add); this.jsonStream.get(getContent("stream.json"), result::add);
assertThat(result).hasSize(595); assertThat(result).hasSize(595);
assertThat(result.get(594).toString()).contains("Status: Downloaded newer image for cloudfoundry/cnb:bionic"); assertThat(result.get(594).toString())
.contains("Status: Downloaded newer image for packeto-buildpacks/cnb:base");
} }
@Test @Test
@ -52,7 +54,8 @@ class JsonStreamTests extends AbstractJsonTests {
this.jsonStream.get(getContent("stream.json"), TestEvent.class, result::add); this.jsonStream.get(getContent("stream.json"), TestEvent.class, result::add);
assertThat(result).hasSize(595); assertThat(result).hasSize(595);
assertThat(result.get(1).getId()).isEqualTo("5667fdb72017"); assertThat(result.get(1).getId()).isEqualTo("5667fdb72017");
assertThat(result.get(594).getStatus()).isEqualTo("Status: Downloaded newer image for cloudfoundry/cnb:bionic"); assertThat(result.get(594).getStatus())
.isEqualTo("Status: Downloaded newer image for packeto-buildpacks/cnb:base");
} }
/** /**

View File

@ -1,11 +1,11 @@
{ {
"Id": "sha256:44cc64492fb6a6d78d3e6d087f380ae6e479aa1b2c79823b32cdacfcc2f3d715", "Id": "sha256:44cc64492fb6a6d78d3e6d087f380ae6e479aa1b2c79823b32cdacfcc2f3d715",
"RepoTags": [ "RepoTags": [
"cloudfoundry/cnb:bionic", "paketo-buildpacks/cnb:base",
"cloudfoundry/cnb:bionic-platform-api-0.3" "paketo-buildpacks/builder:base-platform-api-0.2"
], ],
"RepoDigests": [ "RepoDigests": [
"cloudfoundry/cnb@sha256:5b03a853e636b78c44e475bbc514e2b7b140cc41cca8ab907e9753431ae8c0b0" "packeto-buidpacks/cnb@sha256:5b03a853e636b78c44e475bbc514e2b7b140cc41cca8ab907e9753431ae8c0b0"
], ],
"Parent": "", "Parent": "",
"Comment": "", "Comment": "",

View File

@ -1,7 +1,7 @@
{ {
"User" : "root", "User" : "root",
"Image" : "pack.local/ephemeral-builder", "Image" : "pack.local/ephemeral-builder",
"Cmd" : [ "/lifecycle/cacher", "-path", "/cache", "-layers", "/layers" ], "Cmd" : [ "/lifecycle/analyzer", "-daemon", "-skip-layers", "-layers", "/layers", "docker.io/library/my-application:latest" ],
"Labels" : { "Labels" : {
"author" : "spring-boot" "author" : "spring-boot"
}, },

View File

@ -1,7 +1,7 @@
{ {
"User" : "root", "User" : "root",
"Image" : "pack.local/ephemeral-builder", "Image" : "pack.local/ephemeral-builder",
"Cmd" : [ "/lifecycle/analyzer", "-daemon", "-layers", "/layers", "-cache-dir", "/cache", "docker.io/library/my-application:latest" ], "Cmd" : [ "/lifecycle/analyzer", "-daemon", "-cache-dir", "/cache", "-layers", "/layers", "docker.io/library/my-application:latest" ],
"Labels" : { "Labels" : {
"author" : "spring-boot" "author" : "spring-boot"
}, },

View File

@ -1,10 +1,10 @@
{ {
"Id": "sha256:9b450bffdb05bcf660d464d0bfdf344ee6ca38e9b8de4f408c8080b0c9319349", "Id": "sha256:9b450bffdb05bcf660d464d0bfdf344ee6ca38e9b8de4f408c8080b0c9319349",
"RepoTags": [ "RepoTags": [
"cloudfoundry/cnb:latest" "packeto-buildpacks/cnb:latest"
], ],
"RepoDigests": [ "RepoDigests": [
"cloudfoundry/run@sha256:715806bb793b66e3fc1a5a8f5584c6a1b6db05425e573887673bddcf426f1b90" "packeto-buildpacks/run@sha256:715806bb793b66e3fc1a5a8f5584c6a1b6db05425e573887673bddcf426f1b90"
], ],
"Parent": "", "Parent": "",
"Comment": "", "Comment": "",

View File

@ -1,6 +1,6 @@
{ {
"status": "Pulling from cloudfoundry/cnb", "status": "Pulling from packeto-buildpacks/cnb",
"id": "bionic" "id": "base"
} }
{"status":"Pulling fs layer","progressDetail":{},"id":"5667fdb72017"} {"status":"Pulling fs layer","progressDetail":{},"id":"5667fdb72017"}
{"status":"Pulling fs layer","progressDetail":{},"id":"d83811f270d5"} {"status":"Pulling fs layer","progressDetail":{},"id":"d83811f270d5"}
@ -595,4 +595,4 @@
{"status":"Extracting","progressDetail":{"current":32,"total":32},"progress":"[==================================================\u003e] 32B/32B","id":"4f4fb700ef54"} {"status":"Extracting","progressDetail":{"current":32,"total":32},"progress":"[==================================================\u003e] 32B/32B","id":"4f4fb700ef54"}
{"status":"Pull complete","progressDetail":{},"id":"4f4fb700ef54"} {"status":"Pull complete","progressDetail":{},"id":"4f4fb700ef54"}
{"status":"Digest: sha256:4acb6bfd6c4f0cabaf7f3690e444afe51f1c7de54d51da7e63fac709c56f1c30"} {"status":"Digest: sha256:4acb6bfd6c4f0cabaf7f3690e444afe51f1c7de54d51da7e63fac709c56f1c30"}
{"status":"Status: Downloaded newer image for cloudfoundry/cnb:bionic"} {"status":"Status: Downloaded newer image for packeto-buildpacks/cnb:base"}

View File

@ -1,3 +1,3 @@
{ {
"status": "Status: Downloaded newer image for cloudfoundry/cnb:bionic" "status": "Status: Downloaded newer image for packeto-buildpacks/cnb:base"
} }

View File

@ -1,10 +1,10 @@
{ {
"Id": "sha256:9b450bffdb05bcf660d464d0bfdf344ee6ca38e9b8de4f408c8080b0c9319349", "Id": "sha256:9b450bffdb05bcf660d464d0bfdf344ee6ca38e9b8de4f408c8080b0c9319349",
"RepoTags": [ "RepoTags": [
"cloudfoundry/cnb:latest" "packeto-buildpacks/cnb:latest"
], ],
"RepoDigests": [ "RepoDigests": [
"cloudfoundry/cnb@sha256:915802bb193b66e3fc1a5a8f5584c6a1b6db05425e573887673bddcf426f1b90" "packeto-buildpacks/cnb@sha256:915802bb193b66e3fc1a5a8f5584c6a1b6db05425e573887673bddcf426f1b90"
], ],
"Parent": "", "Parent": "",
"Comment": "", "Comment": "",

View File

@ -1,6 +1,6 @@
{ {
"status": "Pulling from cloudfoundry/cnb", "status": "Pulling from packeto-buildpacks/cnb",
"id": "bionic" "id": "base"
} }
{"status":"Pulling fs layer","progressDetail":{},"id":"5667fdb72017"} {"status":"Pulling fs layer","progressDetail":{},"id":"5667fdb72017"}
{"status":"Pulling fs layer","progressDetail":{},"id":"d83811f270d5"} {"status":"Pulling fs layer","progressDetail":{},"id":"d83811f270d5"}
@ -595,4 +595,4 @@
{"status":"Extracting","progressDetail":{"current":32,"total":32},"progress":"[==================================================\u003e] 32B/32B","id":"4f4fb700ef54"} {"status":"Extracting","progressDetail":{"current":32,"total":32},"progress":"[==================================================\u003e] 32B/32B","id":"4f4fb700ef54"}
{"status":"Pull complete","progressDetail":{},"id":"4f4fb700ef54"} {"status":"Pull complete","progressDetail":{},"id":"4f4fb700ef54"}
{"status":"Digest: sha256:4acb6bfd6c4f0cabaf7f3690e444afe51f1c7de54d51da7e63fac709c56f1c30"} {"status":"Digest: sha256:4acb6bfd6c4f0cabaf7f3690e444afe51f1c7de54d51da7e63fac709c56f1c30"}
{"status":"Status: Downloaded newer image for cloudfoundry/cnb:bionic"} {"status":"Status: Downloaded newer image for packeto-buildpacks/cnb:base"}

View File

@ -48,7 +48,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.
| `cloudfoundry/cnb:bionic-platform-api-0.2` | `gcr.io/paketo-buildpacks/builder:base-platform-api-0.3`
| `imageName` | `imageName`
| `--imageName` | `--imageName`

View File

@ -61,7 +61,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("cloudfoundry/cnb:bionic-platform-api"); assertThat(result.getOutput()).contains("paketo-buildpacks/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,9 +77,9 @@ class BootBuildImageIntegrationTests {
writeLongNameResource(); writeLongNameResource();
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.com/test-image-name"); assertThat(result.getOutput()).contains("example/test-image-name");
assertThat(result.getOutput()).contains("cloudfoundry/cnb:bionic-platform-api"); assertThat(result.getOutput()).contains("paketo-buildpacks/builder");
ImageReference imageReference = ImageReference.of(ImageName.of("example.com/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();
} }
@ -93,11 +93,10 @@ class BootBuildImageIntegrationTests {
writeMainClass(); writeMainClass();
writeLongNameResource(); writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage"); BuildResult result = this.gradleBuild.build("bootBuildImage");
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("example/test-image-v2");
assertThat(result.getOutput()).contains("cloudfoundry/cnb:bionic-platform-api-0.2"); assertThat(result.getOutput()).contains("paketo-buildpacks/builder:base-platform-api-0.2");
ImageReference imageReference = ImageReference.of(ImageName.of(projectName)); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-v2"));
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 +109,12 @@ class BootBuildImageIntegrationTests {
void buildsImageWithCommandLineOptions() throws IOException { void buildsImageWithCommandLineOptions() throws IOException {
writeMainClass(); writeMainClass();
writeLongNameResource(); writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example.com/test-image-name", BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example/test-image-v2",
"--builder=cloudfoundry/cnb:bionic-platform-api-0.2"); "--builder=gcr.io/paketo-buildpacks/builder:base-platform-api-0.2");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example.com/test-image-name"); assertThat(result.getOutput()).contains("example/test-image-v2");
assertThat(result.getOutput()).contains("cloudfoundry/cnb:bionic-platform-api-0.2"); assertThat(result.getOutput()).contains("paketo-buildpacks/builder:base-platform-api-0.2");
ImageReference imageReference = ImageReference.of(ImageName.of("example.com/test-image-name")); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-v2"));
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();
} }

View File

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

View File

@ -7,5 +7,5 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8' targetCompatibility = '1.8'
bootBuildImage { bootBuildImage {
imageName = "example.com/test-image-name" imageName = "example/test-image-name"
} }

View File

@ -7,5 +7,6 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8' targetCompatibility = '1.8'
bootBuildImage { bootBuildImage {
builder = "cloudfoundry/cnb:bionic-platform-api-0.2" imageName = "example/test-image-v2"
builder = "gcr.io/paketo-buildpacks/builder:base-platform-api-0.2"
} }

View File

@ -73,7 +73,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`
| `cloudfoundry/cnb:bionic-platform-api-0.2` | `gcr.io/paketo-buildpacks/builder:base-platform-api-0.3`
| `name` | `name`
| {spring-boot-api}/buildpack/platform/docker/type/ImageReference.html#of-java.lang.String-[Image name] for the generated image. | {spring-boot-api}/buildpack/platform/docker/type/ImageReference.html#of-java.lang.String-[Image name] for the generated image.

View File

@ -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("cloudfoundry/cnb:bionic-platform-api") assertThat(buildLog(project)).contains("Building image").contains("paketo-buildpacks/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,11 +93,13 @@ 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", "cloudfoundry/cnb:bionic-platform-api-0.2") .systemProperty("spring-boot.build-image.builder",
"gcr.io/paketo-buildpacks/builder:base-platform-api-0.2")
.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("cloudfoundry/cnb:bionic-platform-api-0.2").contains("Successfully built image"); .contains("paketo-buildpacks/builder:base-platform-api-0.2")
.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();
@ -112,7 +114,7 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
void whenBuildImageIsInvokedWithV2BuilderImage(MavenBuild mavenBuild) { void whenBuildImageIsInvokedWithV2BuilderImage(MavenBuild mavenBuild) {
mavenBuild.project("build-image-v2-builder").goals("package").execute((project) -> { mavenBuild.project("build-image-v2-builder").goals("package").execute((project) -> {
assertThat(buildLog(project)).contains("Building image") assertThat(buildLog(project)).contains("Building image")
.contains("cloudfoundry/cnb:bionic-platform-api-0.2") .contains("paketo-buildpacks/builder:base-platform-api-0.2")
.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

View File

@ -23,7 +23,7 @@
</goals> </goals>
<configuration> <configuration>
<image> <image>
<builder>cloudfoundry/cnb:bionic-platform-api-0.2</builder> <builder>gcr.io/paketo-buildpacks/builder:base-platform-api-0.2</builder>
</image> </image>
</configuration> </configuration>
</execution> </execution>

View File

@ -57,7 +57,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("docker.io/cloudfoundry/cnb:bionic-platform-api"); assertThat(request.getBuilder().toString()).contains("paketo-buildpacks/builder");
assertThat(request.getEnv()).isEmpty(); assertThat(request.getEnv()).isEmpty();
assertThat(request.isCleanCache()).isFalse(); assertThat(request.isCleanCache()).isFalse();
assertThat(request.isVerboseLogging()).isFalse(); assertThat(request.isVerboseLogging()).isFalse();