-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
53 lines (47 loc) · 1.25 KB
/
.gitlab-ci.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
variables:
#CI_DEBUG_TRACE: "true"
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_IID
stages:
- test
.sonarqube:
stage: test
variables:
GIT_DEPTH: 0
image:
name: $CI_REGISTRY/devops/sonar-scanner-cli:latest
entrypoint: [""]
tags:
- 1c
.cacerts: &cacerts
- keytool -cacerts -storepass changeit -noprompt -trustcacerts -importcert
-alias ${SONAR_SSL_SERVER}
-file "${SONAR_SSL_CERTIFICATE}"
sonarqube_on_merge_request:
extends: .sonarqube
script:
- *cacerts
- export SONAR_SCANNER_OPTS="-Xmx4g"
- sonar-scanner
-D"sonar.host.url=$SONAR_SERVER"
-D"sonar.projectVersion=$CI_COMMIT_TAG"
-D"sonar.login=$SONAR_LOGIN"
-D"sonar.pullrequest.key=$CI_MERGE_REQUEST_IID"
-D"sonar.pullrequest.branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
-D"sonar.pullrequest.base=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
rules:
- if: $CI_MERGE_REQUEST_IID
sonarqube_on_tag:
extends: .sonarqube
script:
- *cacerts
- export SONAR_SCANNER_OPTS="-Xmx4g"
- sonar-scanner
-D"sonar.host.url=$SONAR_SERVER"
-D"sonar.projectVersion=$CI_COMMIT_TAG"
-D"sonar.branch.name=$CI_DEFAULT_BRANCH"
-D"sonar.login=$SONAR_LOGIN"
rules:
- if: $CI_COMMIT_TAG