-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
37 lines (30 loc) · 1.02 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
image: maven:3-jdk-7
variables:
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
-Dorg.slf4j.simpleLogger.showDateTime=true
-Djava.awt.headless=true
-Dmaven.repo.local=.m2/repository"
# Cache downloaded dependencies and plugins between builds.
cache:
paths:
- .m2/repository
stages:
- build
- publish
before_script:
- export REVISION="$(curl http://git.patrikdufresne.com/pdsl/maven-scm-version/raw/master/version.sh | bash -)"
- echo "REVISION=$REVISION"
test:
stage: build
script:
- mvn -B -Drevision=${REVISION} clean install
sonar:
image: maven:3-jdk-8
stage: build
allow_failure: true
script:
- mvn -B -Drevision=${REVISION} -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_TOKEN org.jacoco:jacoco-maven-plugin:prepare-agent clean verify sonar:sonar
nexus_deploy:
stage: publish
script:
- mvn -B -s ./settings.xml -Drevision=${REVISION} clean install deploy