Wende Build Template an - OP#238

This commit is contained in:
2022-08-21 01:44:15 +00:00
parent 86cd6f96b8
commit 0732a8c1bb
15 changed files with 429 additions and 548 deletions
+13 -25
View File
@@ -1,3 +1,6 @@
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- source "/home/gitlab-runner/.sdkman/bin/sdkman-init.sh"
- sdk u java 11.0.12-open
@@ -10,13 +13,7 @@ stages:
Build Application:
stage: build
script: ./gradlew --build-cache build
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- .gradle
script: ./gradlew build
Create Documentation:
stage: build
@@ -24,32 +21,23 @@ Create Documentation:
Test Application:
stage: test
script: ./gradlew check
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle
script:
- ./gradlew check
- python /opt/cover2cover.py build/reports/jacoco/test/jacocoTestReport.xml $CI_PROJECT_DIR/src/main/java/ > build/cobertura.xml
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/cobertura.xml
sonarqube-check:
stage: analysis
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script: ./gradlew sonarqube
allow_failure: true
Publish Artifacts:
stage: publish
script: ./gradlew publish
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle