-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
40 lines (36 loc) · 1.08 KB
/
.gitlab-ci.yml
File metadata and controls
40 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
image: docker:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
SPRING_PROFILES_ACTIVE: gitlab-ci
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
build:
image: maven:3.8.1-openjdk-16
stage: build
services:
- docker:dind
script:
- mvn install test -Dsonar.skip=true
artifacts:
paths:
- target/*.jar
#test_variable:
# stage: test
# script:
# - echo $CI_JOB_STAGE # calls a predefined variable
# - echo $SONAR_HOST_URL # calls a custom variable of type `file` that contains the path to the temp file
# - echo $SONAR_TOKEN # calls a custom variable of type `env_var`
sonarcloud-check:
image: maven:3.8.1-openjdk-16
stage: test
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install verify sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN
only:
- master
- develop