mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish "Update default builder image"
See gh-23628
This commit is contained in:
parent
461dc23c0c
commit
0e7ab88491
@ -55,7 +55,7 @@ public class BuildRequestTests {
|
||||
writeTestJarFile(jarFile);
|
||||
BuildRequest request = BuildRequest.forJarFile(jarFile);
|
||||
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.getEnv()).isEmpty();
|
||||
}
|
||||
@ -66,7 +66,7 @@ public class BuildRequestTests {
|
||||
writeTestJarFile(jarFile);
|
||||
BuildRequest request = BuildRequest.forJarFile(ImageReference.of("test-app"), jarFile);
|
||||
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.getEnv()).isEmpty();
|
||||
}
|
||||
|
@ -60,7 +60,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("paketo-buildpacks/builder");
|
||||
assertThat(result.getOutput()).contains("paketobuildpacks/builder");
|
||||
ImageReference imageReference = ImageReference.of(ImageName.of(projectName));
|
||||
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
|
||||
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
|
||||
@ -77,7 +77,7 @@ class BootBuildImageIntegrationTests {
|
||||
BuildResult result = this.gradleBuild.build("bootBuildImage");
|
||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
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"));
|
||||
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
|
||||
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
|
||||
@ -94,8 +94,8 @@ class BootBuildImageIntegrationTests {
|
||||
BuildResult result = this.gradleBuild.build("bootBuildImage");
|
||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
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("paketo-buildpacks/run:full-cnb-cf");
|
||||
assertThat(result.getOutput()).contains("paketobuildpacks/builder:full");
|
||||
assertThat(result.getOutput()).contains("paketobuildpacks/run:full");
|
||||
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-custom"));
|
||||
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
|
||||
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
|
||||
@ -110,12 +110,11 @@ class BootBuildImageIntegrationTests {
|
||||
writeMainClass();
|
||||
writeLongNameResource();
|
||||
BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example/test-image-cmd",
|
||||
"--builder=gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3",
|
||||
"--runImage=gcr.io/paketo-buildpacks/run:full-cnb-cf");
|
||||
"--builder=paketobuildpacks/builder:full", "--runImage=paketobuildpacks/run:full-cnb");
|
||||
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
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("paketo-buildpacks/run:full-cnb-cf");
|
||||
assertThat(result.getOutput()).contains("paketobuildpacks/builder:full");
|
||||
assertThat(result.getOutput()).contains("paketobuildpacks/run:full");
|
||||
ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-cmd"));
|
||||
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
|
||||
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
|
||||
|
@ -190,7 +190,7 @@ class BootBuildImageTests {
|
||||
|
||||
@Test
|
||||
void whenNoBuilderIsConfiguredThenRequestHasDefaultBuilder() {
|
||||
assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("paketo-buildpacks/builder");
|
||||
assertThat(this.buildImage.createRequest().getBuilder().getName()).isEqualTo("paketobuildpacks/builder");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -8,6 +8,6 @@ targetCompatibility = '1.8'
|
||||
|
||||
bootBuildImage {
|
||||
imageName = "example/test-image-custom"
|
||||
builder = "gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3"
|
||||
runImage = "gcr.io/paketo-buildpacks/run:full-cnb-cf"
|
||||
builder = "paketobuildpacks/builder:full"
|
||||
runImage = "paketobuildpacks/run:full-cnb"
|
||||
}
|
||||
|
@ -93,14 +93,12 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
|
||||
void whenBuildImageIsInvokedWithCommandLineParameters(MavenBuild mavenBuild) {
|
||||
mavenBuild.project("build-image").goals("package")
|
||||
.systemProperty("spring-boot.build-image.imageName", "example.com/test/cmd-property-name:v1")
|
||||
.systemProperty("spring-boot.build-image.builder",
|
||||
"paketobuildpacks/builder:full")
|
||||
.systemProperty("spring-boot.build-image.builder", "paketobuildpacks/builder:full")
|
||||
.systemProperty("spring-boot.build-image.runImage", "paketobuildpacks/run:full-cnb")
|
||||
.execute((project) -> {
|
||||
assertThat(buildLog(project)).contains("Building image")
|
||||
.contains("example.com/test/cmd-property-name:v1")
|
||||
.contains("paketobuildpacks/builder:full")
|
||||
.contains("paketobuildpacks/run:full-cnb").contains("Successfully built image");
|
||||
.contains("example.com/test/cmd-property-name:v1").contains("paketobuildpacks/builder:full")
|
||||
.contains("paketobuildpacks/run:full").contains("Successfully built image");
|
||||
ImageReference imageReference = ImageReference.of("example.com/test/cmd-property-name:v1");
|
||||
try (GenericContainer<?> container = new GenericContainer<>(imageReference.toString())) {
|
||||
container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start();
|
||||
@ -114,9 +112,8 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
|
||||
@TestTemplate
|
||||
void whenBuildImageIsInvokedWithCustomBuilderImageAndRunImage(MavenBuild mavenBuild) {
|
||||
mavenBuild.project("build-image-custom-builder").goals("package").execute((project) -> {
|
||||
assertThat(buildLog(project)).contains("Building image")
|
||||
.contains("paketobuildpacks/builder:full")
|
||||
.contains("paketobuildpacks/run:full-cnb")
|
||||
assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder:full")
|
||||
.contains("paketobuildpacks/run:full")
|
||||
.contains("docker.io/library/build-image-v2-builder:0.0.1.BUILD-SNAPSHOT")
|
||||
.contains("Successfully built image");
|
||||
ImageReference imageReference = ImageReference
|
||||
|
Loading…
Reference in New Issue
Block a user