Merge branch 'gitlab-ci-docs' into 'master'

Gitlab ci docs

See merge request oysteikt/tdt4100-project-2021v!4
This commit is contained in:
Oystein Kristoffer Tveit 2021-03-01 14:24:05 +00:00
commit 09118ee3b2
2 changed files with 28 additions and 22 deletions

View File

@ -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 <source></source> 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/
- master

View File

@ -65,6 +65,14 @@
<scope>test</scope>
</dependency>
<!-- JavaDoc -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<type>maven-plugin</type>
</dependency>
</dependencies>
<build>
<plugins>