From 65398e5db7bea475b951815c4a21f837ebeb7835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Kristoffer=20Tveit?= Date: Mon, 1 Mar 2021 15:24:05 +0100 Subject: [PATCH] Gitlab ci docs --- .gitlab-ci.yml | 42 ++++++++++++++++++++---------------------- pom.xml | 8 ++++++++ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a59d929..1199c67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,8 +22,8 @@ cache: stages: - build - test - - coverage - - report + - docs + - postprocessing - deploy build: @@ -49,47 +49,45 @@ unittest: - target/failsafe-reports/TEST-*.xml generate-coverage: - stage: coverage + stage: docs script: - - 'mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report' + - 'mvn clean jacoco:prepare-agent test jacoco:report' - 'cat target/site/jacoco/index.html' coverage: '/Total.*?([0-9]{1,3})%/' artifacts: paths: - - target/site/ - - target/site/jacoco/jacoco.xml + - target/site/jacoco -report-coverage: - stage: report +process-coverage: + stage: postprocessing image: haynes/jacoco2cobertura:1.0.4 + needs: [generate-coverage] script: # convert report from jacoco to cobertura - 'python /opt/cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml' # read the tag and prepend the path to every filename attribute - 'python /opt/source2filename.py target/site/cobertura.xml' - needs: [generate-coverage] artifacts: reports: cobertura: target/site/cobertura.xml +generate-apidocs: + stage: docs + script: + - 'mvn clean javadoc:javadoc' + artifacts: + paths: + - target/site/apidocs + pages: stage: deploy - needs: [generate-coverage] + needs: [generate-coverage, generate-apidocs] script: - - mv target/site/* public/ + - mv target/site/jacoco public/ + - mv target/site/apidocs public/ artifacts: paths: - public expire_in: 30 days only: - - master - -# integrationtest-job: -# stage: test -# dependencies: -# - build-job -# script: -# - "mvn verify $MAVEN_CLI_OPTS" -# artifacts: -# paths: -# - target/ \ No newline at end of file + - master \ No newline at end of file diff --git a/pom.xml b/pom.xml index 404a641..2b4db6d 100644 --- a/pom.xml +++ b/pom.xml @@ -65,6 +65,14 @@ test + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + maven-plugin + +