mirror of
https://gitlab.com/berufsschul-ae/solatium.git
synced 2024-05-14 23:24:36 +02:00
9154c7ce47
# Conflicts: # .gitlab-ci.yml
68 lines
2 KiB
YAML
68 lines
2 KiB
YAML
image: maven:3.6.0-jdk-8
|
|
|
|
variables:
|
|
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
|
|
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
|
|
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true"
|
|
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
|
|
# when running from the command line.
|
|
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
|
|
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
|
|
|
|
|
|
# Cache downloaded dependencies and plugins between builds.
|
|
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
|
|
# Define a cache with the key: ${CI_COMMIT_REF_SLUG} so that jobs of each branch always use the same cache
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- .m2/repository
|
|
- target/
|
|
|
|
|
|
stages:
|
|
- compile
|
|
- test
|
|
- package
|
|
- analyse
|
|
|
|
mvn-compile:
|
|
stage: compile
|
|
script:
|
|
- "mvn $MAVEN_CLI_OPTS clean compile"
|
|
|
|
mvn-unit-test:
|
|
stage: test
|
|
coverage: '/Total.*?([0-9]{1,3})%/'
|
|
script:
|
|
- "mvn $MAVEN_CLI_OPTS test"
|
|
|
|
mvn-integration-test:
|
|
stage: test
|
|
coverage: '/Total.*?([0-9]{1,3})%/'
|
|
script:
|
|
- "mvn $MAVEN_CLI_OPTS integration-test"
|
|
- "cat target/site/jacoco/index.html"
|
|
|
|
mvn-package:
|
|
stage: package
|
|
script:
|
|
- "mvn $MAVEN_CLI_OPTS package"
|
|
artifacts:
|
|
paths:
|
|
- target/*.jar
|
|
expire_in: 1 day
|
|
|
|
mvn-master-package:
|
|
stage: package
|
|
script:
|
|
- "mvn $MAVEN_CLI_OPTS package"
|
|
artifacts:
|
|
paths:
|
|
- target/*.jar
|
|
only:
|
|
- master
|
|
|
|
mvn-sonar-analyse:
|
|
stage: analyse
|
|
script: "mvn sonar:sonar -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.organization=$SONAR_ORGANIZATION -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN" |