-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbitbucket-pipelines.yml
23 lines (21 loc) · 1.31 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
image: gcc:10.2
clone:
depth: full # SonarQube scanner needs the full history to assign issues properly
pipelines:
branches:
master:
- step:
name: Build and analyze on SonarQube
script:
- curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
- unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
- curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- export PATH="$HOME/.sonar/sonar-scanner-5.0.1.3006-linux/bin:$HOME/.sonar/build-wrapper-linux-x86:$PATH"
- export BW_OUTPUT=build_wrapper_output_directory
- autoreconf --install
- ./configure
- build-wrapper-linux-x86-64 --out-dir $BW_OUTPUT make clean all
- sonar-scanner -Dsonar.cfamily.compile-commands=$BW_OUTPUT/compile_commands.json
# if you are using using SonarQube 10.5 or earlier, replace -Dsonar.cfamily.compile-commands with -Dsonar.cfamily.build-wrapper-output=$BW_OUTPUT
# as build-wrapper does not generate a compile_commands.json file before SonarQube 10.6