Search in sources :

Example 21 with BuildRequest

use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.

the class ImageTests method getBuildRequestWhenNameIsNullDeducesName.

@Test
void getBuildRequestWhenNameIsNullDeducesName() {
    BuildRequest request = new Image().getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.getName().toString()).isEqualTo("docker.io/library/my-app:0.0.1-SNAPSHOT");
}
Also used : BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) Test(org.junit.jupiter.api.Test)

Example 22 with BuildRequest

use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.

the class ImageTests method getBuildRequestWhenHasLaunchVolumeCacheUsesCache.

@Test
void getBuildRequestWhenHasLaunchVolumeCacheUsesCache() {
    Image image = new Image();
    image.launchCache = new CacheInfo(new VolumeCacheInfo("launch-cache-vol"));
    BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.getLaunchCache()).isEqualTo(Cache.volume("launch-cache-vol"));
}
Also used : VolumeCacheInfo(org.springframework.boot.maven.CacheInfo.VolumeCacheInfo) BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) VolumeCacheInfo(org.springframework.boot.maven.CacheInfo.VolumeCacheInfo) Test(org.junit.jupiter.api.Test)

Example 23 with BuildRequest

use of org.springframework.boot.buildpack.platform.build.BuildRequest in project spring-boot by spring-projects.

the class ImageTests method getBuildRequestWhenHasEnvUsesEnv.

@Test
void getBuildRequestWhenHasEnvUsesEnv() {
    Image image = new Image();
    image.env = Collections.singletonMap("test", "test");
    BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.getEnv()).containsExactly(entry("test", "test"));
}
Also used : BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) Test(org.junit.jupiter.api.Test)

Aggregations

BuildRequest (org.springframework.boot.buildpack.platform.build.BuildRequest)23 Test (org.junit.jupiter.api.Test)20 Builder (org.springframework.boot.buildpack.platform.build.Builder)3 IOException (java.io.IOException)2 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2 DockerConfiguration (org.springframework.boot.buildpack.platform.docker.configuration.DockerConfiguration)2 Libraries (org.springframework.boot.loader.tools.Libraries)2 VolumeCacheInfo (org.springframework.boot.maven.CacheInfo.VolumeCacheInfo)2 File (java.io.File)1 OutputStream (java.io.OutputStream)1 Duration (java.time.Duration)1 Collections (java.util.Collections)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 Supplier (java.util.function.Supplier)1 ZipEntry (java.util.zip.ZipEntry)1 TarArchiveEntry (org.apache.commons.compress.archivers.tar.TarArchiveEntry)1 TarArchiveOutputStream (org.apache.commons.compress.archivers.tar.TarArchiveOutputStream)1 TarConstants (org.apache.commons.compress.archivers.tar.TarConstants)1 Artifact (org.apache.maven.artifact.Artifact)1