-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
105 lines (87 loc) · 2.48 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
image: 3.5-jdk-8-alpine
before_script:
- whoami
- pwd
- echo $PATH
- which mvn
- which java
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
SONAR_URL: "http://10.100.35.41:9000"
cache:
paths:
- .m2/repository
# This will only validate and compile stuff and run e.g. maven-enforcer-plugin.
# Because some enforcer rules might check dependency convergence and class duplications
# we use `test-compile` here instead of `validate`, so the correct classpath is picked up.
compile:
stage: build
script:
- 'mvn $MAVEN_CLI_OPTS test-compile'
# Run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
verify:
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS verify'
artifacts:
paths:
- target/*.jar
#junit:
# image: elct9620/gitlab-android-junit
# script:
# - ./gradlew test
# sonar:
# image: elct9620/gitlab-sonar-scanner
# script:
# - "/bin/true"
# package:
# script:
# - mvn clean install
sonarqube_preview:
script:
- git checkout origin/master
- git merge $CI_BUILD_REF --no-commit --no-ff
- mvn --batch-mode verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=admin -Dsonar.password=admin -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref_name=$CI_BUILD_REF_NAME
stage: test
except:
- develop
- master
- /^hotfix_.*$/
- /.*-hotfix$/
# tags:
# - java
sonarqube:
script:
- mvn --batch-mode verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=admin -Dsonar.password=admin
stage: test
only:
- master
# tags:
# - java
sonar_preview:
stage: test
script:
- ci/sonar_preview.sh
except:
- master
# tags:
# - hwy
auto_test:
stage: test
script:
- ci/auto_test.sh
except:
- master
# tags:
# - hwy
sonar_analyze:
stage: test
script:
#- ci/sonar_analyze.sh
- mvn --batch-mode sonar:sonar -Dsonar.host.url="http://10.100.35.41:9000" -Dsonar.login=admin -Dsonar.password=admin -Dsonar.issuesReport.html.enable=true -Dsonar.analysis.mode=preview -Dsonar.preview.excludePlugins=issueassign,scmstats
only:
- master
# tags:
# - hwy