Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ bootBuildImage {
}
}
// end::publish[]

task bootBuildImagePublish {
doFirst {
println(tasks.bootBuildImage.publish)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tasks.getByName<BootJar>("bootJar") {
// tag::publish[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
imageName = "docker.example.com/library/${project.name}"
publish = true
isPublish = true
docker {
publishRegistry {
username = "user"
Expand All @@ -24,3 +24,9 @@ tasks.getByName<BootBuildImage>("bootBuildImage") {
}
}
// end::publish[]

tasks.register("bootBuildImagePublish") {
doFirst {
println(tasks.getByName<BootBuildImage>("bootBuildImage").isPublish)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ void bootBuildImageWithCustomImageName() throws IOException {
assertThat(result.getOutput()).contains("example.com/library/" + this.gradleBuild.getProjectDir().getName());
}

@TestTemplate
void bootBuildImagePublish() throws IOException {
BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-publish")
.build("bootBuildImagePublish");
assertThat(result.getOutput()).contains("true");
}

protected void jarFile(File file) throws IOException {
try (JarOutputStream jar = new JarOutputStream(new FileOutputStream(file))) {
jar.putNextEntry(new ZipEntry("META-INF/MANIFEST.MF"));
Expand Down