Use build template
This commit is contained in:
+50
-15
@@ -1,20 +1,55 @@
|
||||
Create Application:
|
||||
before_script:
|
||||
- source "/home/gitlab-runner/.sdkman/bin/sdkman-init.sh"
|
||||
- sdk u java 11.0.12-open
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- analysis
|
||||
- publish
|
||||
|
||||
Build Application:
|
||||
stage: build
|
||||
script:
|
||||
- chmod +x gradlew
|
||||
- ./gradlew build
|
||||
script: ./gradlew --build-cache build
|
||||
cache:
|
||||
key: "$CI_COMMIT_REF_NAME"
|
||||
policy: push
|
||||
paths:
|
||||
- build
|
||||
- .gradle
|
||||
|
||||
Create Documentation:
|
||||
stage: build
|
||||
script:
|
||||
- chmod +x gradlew
|
||||
- ./gradlew asciidoctor
|
||||
artifacts:
|
||||
paths:
|
||||
- build/docs/asciidocPdf/generations.pdf
|
||||
script: ./gradlew asciidoctorPdf
|
||||
|
||||
Build Library:
|
||||
stage: build
|
||||
script:
|
||||
- chmod +x gradlew
|
||||
- ./gradlew publish
|
||||
Test Application:
|
||||
stage: test
|
||||
script: ./gradlew check
|
||||
cache:
|
||||
key: "$CI_COMMIT_REF_NAME"
|
||||
policy: pull
|
||||
paths:
|
||||
- build
|
||||
- .gradle
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user