Use platform API builder image tags

CNB builder images are now being tagged in a manner that indicates
the version of the platform API implemented. This allows Spring Boot
to default to a builder tag that guarantees API compatibility while
allowing for updates to bundled buildpacks.

Fixes gh-20171
This commit is contained in:
Scott Frederick
2020-03-31 20:00:41 -05:00
parent 4dad56a491
commit bb9e37e119
10 changed files with 21 additions and 18 deletions

View File

@@ -52,7 +52,7 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
assertThat(jar).isFile();
File original = new File(project, "target/build-image-0.0.1.BUILD-SNAPSHOT.jar.original");
assertThat(original).doesNotExist();
assertThat(buildLog(project)).contains("Building image").contains("cloudfoundry/cnb:0.0.53-bionic")
assertThat(buildLog(project)).contains("Building image").contains("cloudfoundry/cnb:bionic-platform-api")
.contains("docker.io/library/build-image:0.0.1.BUILD-SNAPSHOT")
.contains("Successfully built image");
ImageReference imageReference = ImageReference.of(ImageName.of("build-image"), "0.0.1.BUILD-SNAPSHOT");
@@ -93,11 +93,11 @@ 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", "cloudfoundry/cnb:0.0.43-bionic")
.systemProperty("spring-boot.build-image.builder", "cloudfoundry/cnb:bionic-platform-api-0.1")
.execute((project) -> {
assertThat(buildLog(project)).contains("Building image")
.contains("example.com/test/cmd-property-name:v1")
.contains("cloudfoundry/cnb:0.0.43-bionic").contains("Successfully built image");
.contains("cloudfoundry/cnb:bionic-platform-api-0.1").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();
@@ -111,7 +111,8 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests {
@TestTemplate
void whenBuildImageIsInvokedWithV1BuilderImage(MavenBuild mavenBuild) {
mavenBuild.project("build-image-v1-builder").goals("package").execute((project) -> {
assertThat(buildLog(project)).contains("Building image").contains("cloudfoundry/cnb:0.0.43-bionic")
assertThat(buildLog(project)).contains("Building image")
.contains("cloudfoundry/cnb:bionic-platform-api-0.1")
.contains("docker.io/library/build-image-v1-builder:0.0.1.BUILD-SNAPSHOT")
.contains("Successfully built image");
ImageReference imageReference = ImageReference

View File

@@ -23,7 +23,7 @@
</goals>
<configuration>
<image>
<builder>cloudfoundry/cnb:0.0.43-bionic</builder>
<builder>cloudfoundry/cnb:bionic-platform-api-0.1</builder>
</image>
</configuration>
</execution>