use of org.springframework.boot.buildpack.platform.io.TarArchive in project spring-boot by spring-projects.
the class BuildImageMojo method getBuildRequest.
private BuildRequest getBuildRequest(Libraries libraries) throws MojoExecutionException {
ImagePackager imagePackager = new ImagePackager(getArchiveFile(), getBackupFile());
Function<Owner, TarArchive> content = (owner) -> getApplicationContent(owner, libraries, imagePackager);
Image image = (this.image != null) ? this.image : new Image();
if (image.name == null && this.imageName != null) {
image.setName(this.imageName);
}
if (image.builder == null && this.imageBuilder != null) {
image.setBuilder(this.imageBuilder);
}
if (image.runImage == null && this.runImage != null) {
image.setRunImage(this.runImage);
}
if (image.cleanCache == null && this.cleanCache != null) {
image.setCleanCache(this.cleanCache);
}
if (image.pullPolicy == null && this.pullPolicy != null) {
image.setPullPolicy(this.pullPolicy);
}
if (image.publish == null && this.publish != null) {
image.setPublish(this.publish);
}
if (image.network == null && this.network != null) {
image.setNetwork(this.network);
}
if (image.publish != null && image.publish && publishRegistryNotConfigured()) {
throw new MojoExecutionException("Publishing an image requires docker.publishRegistry to be configured");
}
return customize(image.getBuildRequest(this.project.getArtifact(), content));
}
use of org.springframework.boot.buildpack.platform.io.TarArchive in project spring-boot by spring-projects.
the class LifecycleTests method getTestRequest.
private BuildRequest getTestRequest() {
TarArchive content = mock(TarArchive.class);
ImageReference name = ImageReference.of("my-application");
return BuildRequest.of(name, (owner) -> content).withRunImage(ImageReference.of("cloudfoundry/run"));
}
use of org.springframework.boot.buildpack.platform.io.TarArchive in project spring-boot by spring-projects.
the class ContainerContentTests method ofWhenDestinationPathIsEmptyThrowsException.
@Test
void ofWhenDestinationPathIsEmptyThrowsException() {
TarArchive archive = mock(TarArchive.class);
assertThatIllegalArgumentException().isThrownBy(() -> ContainerContent.of(archive, "")).withMessage("DestinationPath must not be empty");
}
use of org.springframework.boot.buildpack.platform.io.TarArchive in project spring-boot by spring-projects.
the class ContainerContentTests method ofWhenDestinationPathIsNullThrowsException.
@Test
void ofWhenDestinationPathIsNullThrowsException() {
TarArchive archive = mock(TarArchive.class);
assertThatIllegalArgumentException().isThrownBy(() -> ContainerContent.of(archive, null)).withMessage("DestinationPath must not be empty");
}
use of org.springframework.boot.buildpack.platform.io.TarArchive in project spring-boot by spring-projects.
the class BuilderTests method getTestRequest.
private BuildRequest getTestRequest() {
TarArchive content = mock(TarArchive.class);
ImageReference name = ImageReference.of("my-application");
return BuildRequest.of(name, (owner) -> content);
}
Aggregations