Skip to content

Commit 1bb0eb3

Browse files
committed
#369 Build Docker locally and fail on errors
The integration test must run with a local image first
1 parent a81384f commit 1bb0eb3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ tasks.register("integrationTestOnly") {
354354
dependsOn(
355355
':publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository',
356356
':htmlSanityCheck-cli:installDist',
357-
':htmlSanityCheck-cli:dockerBuild'
357+
':htmlSanityCheck-cli:dockerBuildLocal'
358358
)
359359

360360
doLast {

htmlSanityCheck-cli/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ docker {
5656
applyLatestTag = false
5757
}
5858

59+
tasks.register('dockerBuildLocal', com.fussionlabs.gradle.docker.tasks.DockerBuildx) {
60+
loadImage = true
61+
pushImage = false
62+
63+
dependsOn shadowJar
64+
}
65+
5966
/*
6067
* Copyright Gerd Aschemann and aim42 contributors.
6168
*

integration-test/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ tasks.register("integrationTestDocker") {
226226
String docsDir = file("${INTEGRATION_TEST_DIRECTORY_COMMON_BUILD}/docs").absolutePath
227227
String reportsDir = buildReportsDirectory.absolutePath
228228

229-
String params = "--rm -v \"${docsDir}:${docsDir}\" -v \"${reportsDir}\":/reports -w \"${docsDir}\" ${image} -r /reports --exclude https://www\\.baeldung\\.com/.*"
229+
String params = "--rm -v \"${docsDir}:${docsDir}\" -v \"${reportsDir}\":/reports -w \"${docsDir}\" ${image} -r /reports --exclude https://www\\.baeldung\\.com/.* --fail-on-errors"
230230
def result = exec {
231231
if (System.getProperty("os.name") ==~ /Windows.*/) {
232232
// Use cmd to run docker on Windows

0 commit comments

Comments
 (0)