From 123321473628cbacd35963f4f30bf2ab621fd3b7 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 15 Jul 2021 14:59:06 +0100 Subject: Add profile for generating Swagger documents This commit adds a profile for generating Swagger documents and creating a tarball containing the swagger.json, swagger.html, and swagger.pdf files. The profile is triggered in any module when tsts are enabled (In other words when the skipTests flag is off), and when the following proerty is set: post-integration-test This profile assumes that a unit test exists that creates the following file: target/swagger/swagger.json If this file does not exist, the build will fail if the profile is invoked. Therefore, to generate the Swagger documentation tarball, a module must set the swagger.generation.phase propety AND have a unit test that generates the swagger.json file. Issue-ID: POLICY-3424 Change-Id: I8ff769e7a28bf0e00969d1bc677fee6908951d8a Signed-off-by: liamfallon --- resources/src/main/resources/asciidoc/swagger.adoc | 4 +++ .../src/main/resources/assemblies/swagger-docs.xml | 40 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 resources/src/main/resources/asciidoc/swagger.adoc create mode 100644 resources/src/main/resources/assemblies/swagger-docs.xml (limited to 'resources/src') diff --git a/resources/src/main/resources/asciidoc/swagger.adoc b/resources/src/main/resources/asciidoc/swagger.adoc new file mode 100644 index 00000000..e2543364 --- /dev/null +++ b/resources/src/main/resources/asciidoc/swagger.adoc @@ -0,0 +1,4 @@ +include::{generated}/overview.adoc[] +include::{generated}/paths.adoc[] +include::{generated}/security.adoc[] +include::{generated}/definitions.adoc[] diff --git a/resources/src/main/resources/assemblies/swagger-docs.xml b/resources/src/main/resources/assemblies/swagger-docs.xml new file mode 100644 index 00000000..1a1934f3 --- /dev/null +++ b/resources/src/main/resources/assemblies/swagger-docs.xml @@ -0,0 +1,40 @@ + + + + swagger-docs + + tar.gz + + false + + + ${project.build.directory}/swagger + + + *.json + *.html + *.pdf + + ${file.separator}swagger + unix + + + -- cgit 1.2.3-korg