(2.3.x): Updating docs plugin and base image

This commit is contained in:
Alberto C. Ríos
2023-09-07 12:58:30 +02:00
committed by Gareth Clay
parent 67fbf95fde
commit 0747545fcd
3 changed files with 53 additions and 24 deletions

View File

@@ -149,8 +149,39 @@ subprojects {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
test {
useJUnitPlatform()
tasks.withType(Test).forEach { Test task ->
task.with {
// enable JUnit 5
useJUnitPlatform()
scanForTestClasses = true
group = "verification"
testLogging {
exceptionFormat = "full"
events = ["passed", "skipped", "failed"]
}
// print failed tests after the execution
def failedTests = []
afterTest { test, result ->
if (result.resultType == TestResult.ResultType.FAILURE) {
failedTests << test
}
}
// create a summary after the execution
afterSuite { desc, result ->
if (!desc.parent) {
println "\nTest result: ${result.resultType}"
println "Test summary: ${result.testCount} tests, " +
"${result.successfulTestCount} succeeded, " +
"${result.failedTestCount} failed, " +
"${result.skippedTestCount} skipped"
failedTests.each { test -> println "FAILED test: ${test.className} > ${test.name}" }
}
}
}
}
}

View File

@@ -1,4 +1,7 @@
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/library/ubuntu:bionic
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/library/ubuntu:jammy
ARG CONCOURSE_JAVA_SCRIPTS_VERSION=0.0.4
ARG CONCOURSE_RELEASE_SCRIPTS_VERSION=0.3.4
RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates net-tools git curl jq gnupg
@@ -10,5 +13,5 @@ RUN mkdir -p /opt/openjdk && \
cd /opt/openjdk && \
curl -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz | tar xz --strip-components=1
ADD https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh /opt/
ADD https://repo.spring.io/libs-snapshot/io/spring/concourse/releasescripts/concourse-release-scripts/0.3.4-SNAPSHOT/concourse-release-scripts-0.3.4-SNAPSHOT.jar /opt/
ADD "https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v$CONCOURSE_JAVA_SCRIPTS_VERSION/concourse-java.sh" /opt/
ADD "https://repo.spring.io/ui/native/snapshot/io/spring/concourse/releasescripts/concourse-release-scripts/$CONCOURSE_RELEASE_SCRIPTS_VERSION/concourse-release-scripts-$CONCOURSE_RELEASE_SCRIPTS_VERSION.jar" /opt/

View File

@@ -15,7 +15,7 @@
*/
plugins {
id 'org.asciidoctor.jvm.convert' version '3.2.0'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
}
dependencyManagement {
@@ -28,7 +28,7 @@ dependencyManagement {
description = "Spring CredHub Documentation"
configurations {
docs
asciidoctorExtensions
}
dependencies {
@@ -36,16 +36,11 @@ dependencies {
implementation("io.projectreactor:reactor-core")
implementation("org.springframework.boot:spring-boot-autoconfigure")
docs("io.spring.docresources:spring-doc-resources:0.2.5@zip")
asciidoctorExtensions "io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.7"
}
task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
// copy doc resources
from {
configurations.docs.collect { zipTree(it) }
}
// and doc sources
// Copy doc sources
from "src/docs/asciidoc"
// to a temporary build directory
into "$buildDir/asciidoc"
@@ -53,6 +48,10 @@ task prepareAsciidocBuild(type: Sync) {
asciidoctor {
baseDirFollowsSourceFile()
configurations "asciidoctorExtensions"
outputOptions {
backends "spring-html"
}
sourceDir = file("$buildDir/asciidoc")
sources {
include '*.adoc'
@@ -63,17 +62,14 @@ asciidoctor {
}
}
logDocuments = true
// backends = ["html5"]
options doctype: 'book', eruby: 'erubis'
attributes 'icons': 'font',
attributes 'revnumber': project.version,
'spring-version': project.version,
'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'main' : "v${project.version}",
'icons': 'font',
'idprefix': '',
'idseparator': '-',
docinfo: 'shared',
revnumber: project.version,
'spring-version': "${springVersion}",
'spring-boot-version': "${springBootVersion}",
'spring-security-version': "${springSecurityVersion}",
'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'main' : "v${project.version}",
sectanchors: '',
sectnums: '',
stylesdir: "css/",
@@ -83,9 +79,8 @@ asciidoctor {
'allow-uri-read': '',
'source-highlighter': 'highlight.js',
'highlightjsdir': 'js/highlight',
'highlightjs-theme': 'github'
'highlightjs-theme': 'github',
'project-version': project.version
}
asciidoctor.dependsOn prepareAsciidocBuild
configurations.archives.artifacts.clear()