Skip to content
Snippets Groups Projects
Commit b92caebe authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Improve CI job configurations

* Adjust stages to increase parallelization
* Run SonarQube at the end and adjust dependencies so it has all data
  available
parent e67dbf23
No related merge requests found
variables:
WAR_FILE: target/arsnova-backend-*.war
OUTPUT_DIR: target
WAR_FILE: $OUTPUT_DIR/arsnova-backend-*.war
stages:
- analysis
- test
- build
- post-build
- deploy
cache:
paths:
- .m2/
sonar:
stage: analysis
only:
- master
checkstyle:
stage: build
tags:
- maven
allow_failure: true
script:
- mvn sonar:sonar
- mvn checkstyle:checkstyle
checkstyle:
stage: analysis
compile:
stage: build
tags:
- maven
artifacts:
paths:
- $OUTPUT_DIR
script:
- mvn checkstyle:checkstyle
- mvn test-compile
test:
stage: test
unit_test:
stage: post-build
tags:
- maven
dependencies:
- compile
artifacts:
paths:
- $OUTPUT_DIR
script:
- mvn test
- mvn surefire:test
package:
stage: build
stage: post-build
tags:
- maven
dependencies:
- compile
artifacts:
name: package
paths:
- $WAR_FILE
script:
- mvn package -DskipTests
- mvn war:war
.deploy: &deploy
stage: deploy
......@@ -53,6 +61,8 @@ package:
variables:
DEPLOY_CONTEXT: api
GIT_STRATEGY: none
dependencies:
- package
script:
# Do some variable magic to access host-specific variables
- PREFIX=$(echo $CI_ENVIRONMENT_NAME | tr '.:/-' '_')
......@@ -92,3 +102,16 @@ tomcat_development:
#- $DEV_DEPLOY_HOST =~ /^([a-z0-9-]+\.)*[a-z0-9-]+(:[0-9]+)?$/
before_script:
- DEPLOY_HOST=$DEV_DEPLOY_HOST
sonarqube:
stage: deploy
only:
- master
tags:
- maven
dependencies:
- compile
- unit_test
allow_failure: true
script:
- mvn sonar:sonar
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment