-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
63 lines (63 loc) · 1.71 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
image: maven:3.3.3-jdk-8
stages:
- build
- test
- deploy
build_job:
stage: build
only:
- master
script:
- mvn --batch-mode compile -Dmaven.test.skip=true -Djacoco.skip=true -PCI
tags:
- docker
build_merge_job:
stage: build
except:
- master
- tags
script:
- git merge origin master --no-commit --no-ff
- mvn --batch-mode compile -Dmaven.test.skip=true -Djacoco.skip=true -PCI
tags:
- docker
test_sonar_preview_job:
stage: test
except:
- master
- tags
script:
- git merge origin master --no-commit --no-ff
- mvn --batch-mode verify org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref=$CI_BUILD_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -PCI
tags:
- docker
test_sonar_job:
stage: test
only:
- master
script:
- mvn --batch-mode verify org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -PCI
- java -jar deploy/sonar-gate-breaker-all-1.0.1.jar -u $SONAR_LOGIN
tags:
- docker
deploy_job:
stage: deploy
only:
- master
script:
- mvn --batch-mode deploy -Dmaven.test.skip=true -Djacoco.skip=true -PCI
tags:
- docker
deploy_tags_job:
stage: deploy
only:
- tags
script:
- mvn --batch-mode org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion=$CI_BUILD_REF_NAME -DgenerateBackupPoms=false
- mvn --batch-mode clean deploy -Dmaven.test.skip=true -Djacoco.skip=true -PCI,release
artifacts:
expire_in: 1 week
paths:
- target/sonar-gate-breaker-all-*.jar
tags:
- docker