use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenHasBuildVolumeCacheUsesCache.
@Test
void getBuildRequestWhenHasBuildVolumeCacheUsesCache() {
Image image = new Image();
image.buildCache = new CacheInfo(new VolumeCacheInfo("build-cache-vol"));
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.getBuildCache()).isEqualTo(Cache.volume("build-cache-vol"));
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenHasCleanCacheUsesCleanCache.
@Test
void getBuildRequestWhenHasCleanCacheUsesCleanCache() {
Image image = new Image();
image.cleanCache = true;
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.isCleanCache()).isTrue();
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class ImageTests method getBuildRequestWhenHasPublishUsesPublish.
@Test
void getBuildRequestWhenHasPublishUsesPublish() {
Image image = new Image();
image.publish = true;
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
assertThat(request.isPublish()).isTrue();
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class BootBuildImage method buildImage.
@TaskAction
void buildImage() throws DockerEngineException, IOException {
Builder builder = new Builder(this.docker.asDockerConfiguration());
BuildRequest request = createRequest();
builder.build(request);
}
use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.
the class BootBuildImageTests method whenImageNameIsSpecifiedThenItIsUsedInRequest.
@Test
void whenImageNameIsSpecifiedThenItIsUsedInRequest() {
this.project.setVersion("1.2.3");
this.buildImage.setImageName("example.com/test/build-image:1.0");
assertThat(this.buildImage.getImageName()).isEqualTo("example.com/test/build-image:1.0");
BuildRequest request = this.buildImage.createRequest();
assertThat(request.getName().getDomain()).isEqualTo("example.com");
assertThat(request.getName().getName()).isEqualTo("test/build-image");
assertThat(request.getName().getTag()).isEqualTo("1.0");
assertThat(request.getName().getDigest()).isNull();
}
Aggregations