Search in sources :

Example 16 with BuildRequest

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

the class ImageTests method getBuildRequestWhenHasBindingsUsesBindings.

@Test
void getBuildRequestWhenHasBindingsUsesBindings() {
    Image image = new Image();
    image.bindings = Arrays.asList("host-src:container-dest:ro", "volume-name:container-dest:rw");
    BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.getBindings()).containsExactly(Binding.of("host-src:container-dest:ro"), Binding.of("volume-name:container-dest:rw"));
}
Also used : BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) Test(org.junit.jupiter.api.Test)

Example 17 with BuildRequest

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

the class ImageTests method getBuildRequestWhenHasBuilderUsesBuilder.

@Test
void getBuildRequestWhenHasBuilderUsesBuilder() {
    Image image = new Image();
    image.builder = "springboot/builder:2.2.x";
    BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.getBuilder().toString()).isEqualTo("docker.io/springboot/builder:2.2.x");
}
Also used : BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) Test(org.junit.jupiter.api.Test)

Example 18 with BuildRequest

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

the class ImageTests method getBuildRequestWhenHasVerboseLoggingUsesVerboseLogging.

@Test
void getBuildRequestWhenHasVerboseLoggingUsesVerboseLogging() {
    Image image = new Image();
    image.verboseLogging = true;
    BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.isVerboseLogging()).isTrue();
}
Also used : BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) Test(org.junit.jupiter.api.Test)

Example 19 with BuildRequest

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

the class ImageTests method getBuildRequestWhenNetworkUsesNetwork.

@Test
void getBuildRequestWhenNetworkUsesNetwork() {
    Image image = new Image();
    image.network = "test";
    BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.getNetwork()).isEqualTo("test");
}
Also used : BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) Test(org.junit.jupiter.api.Test)

Example 20 with BuildRequest

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

the class ImageTests method getBuildRequestWhenHasTagsUsesTags.

@Test
void getBuildRequestWhenHasTagsUsesTags() {
    Image image = new Image();
    image.tags = Arrays.asList("my-app:latest", "example.com/my-app:0.0.1-SNAPSHOT", "example.com/my-app:latest");
    BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
    assertThat(request.getTags()).containsExactly(ImageReference.of("my-app:latest"), ImageReference.of("example.com/my-app:0.0.1-SNAPSHOT"), ImageReference.of("example.com/my-app:latest"));
}
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