-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
38 lines (36 loc) · 1.13 KB
/
bitbucket-pipelines.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
image: maven:3.6.3-jdk-11
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- maven
- sonar
script:
- mvn -B verify --file pom.xml
- mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
- mvn -B org.jacoco:jacoco-maven-plugin:prepare-agent verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar # used for unit testing report
- mvn -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml sonar:sonar
artifacts:
- target/**
- step: &build-test
name: Build and test
caches:
- maven
script:
- mvn -B verify
artifacts:
- target/**
pipelines:
default:
- step: *build-test
branches:
master:
- step: *build-test-sonarcloud
pull-requests:
'**':
- step: *build-test-sonarcloud