Add support for build workspace option when building images

Closes gh-37478
This commit is contained in:
Scott Frederick
2023-09-20 13:30:20 -05:00
parent d8576f319e
commit 4433fcd1f2
19 changed files with 239 additions and 58 deletions

View File

@@ -343,7 +343,8 @@ class PackagingDocumentationTests {
void bootBuildImageWithBindCaches() {
BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-bind-caches")
.build("bootBuildImageCaches");
assertThat(result.getOutput()).containsPattern("buildCache=/tmp/cache-gradle-[\\d]+.build")
assertThat(result.getOutput()).containsPattern("buildWorkspace=/tmp/cache-gradle-[\\d]+.work")
.containsPattern("buildCache=/tmp/cache-gradle-[\\d]+.build")
.containsPattern("launchCache=/tmp/cache-gradle-[\\d]+.launch");
}

View File

@@ -11,6 +11,11 @@ java {
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildWorkspace {
bind {
source = System.getProperty('java.io.tmpdir') + "/junit-image-pack-${rootProject.name}-work"
}
}
buildCache {
bind {
source = System.getProperty('java.io.tmpdir') + "/junit-image-cache-${rootProject.name}-build"

View File

@@ -11,6 +11,11 @@ java {
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildWorkspace {
volume {
name = "pack-${rootProject.name}.work"
}
}
buildCache {
volume {
name = "cache-${rootProject.name}.build"