Ray Milkey | 20d2252 | 2017-11-08 10:55:52 -0800 | [diff] [blame] | 1 | #!/bin/bash -ex |
| 2 | ONOS_ROOT=`pwd` |
| 3 | . tools/build/envDefaults |
| 4 | |
Ray Milkey | faa66c9 | 2017-11-08 12:58:43 -0800 | [diff] [blame] | 5 | # download and install Sonar scanner |
Ray Milkey | b3f5244 | 2017-11-08 12:22:54 -0800 | [diff] [blame] | 6 | SONAR_SCANNER_VERSION=3.0.3.778 |
Ray Milkey | abba832 | 2017-11-08 12:03:58 -0800 | [diff] [blame] | 7 | curl -L -o /tmp/sonar-scanner-cli.zip -X GET https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip |
Ray Milkey | 20d2252 | 2017-11-08 10:55:52 -0800 | [diff] [blame] | 8 | unzip /tmp/sonar-scanner-cli.zip |
Ray Milkey | faa66c9 | 2017-11-08 12:58:43 -0800 | [diff] [blame] | 9 | |
| 10 | # Configure ONOS specific properties |
Ray Milkey | b3f5244 | 2017-11-08 12:22:54 -0800 | [diff] [blame] | 11 | echo "sonar.host.url=http://sonar.onosproject.org" >>sonar-scanner-$SONAR_SCANNER_VERSION/conf/sonar-scanner.properties |
Ray Milkey | 20d2252 | 2017-11-08 10:55:52 -0800 | [diff] [blame] | 12 | |
Ray Milkey | 04e6f5e | 2017-11-08 13:14:11 -0800 | [diff] [blame^] | 13 | # Be sure buck is installed |
| 14 | onos-buck --version |
| 15 | |
Ray Milkey | faa66c9 | 2017-11-08 12:58:43 -0800 | [diff] [blame] | 16 | # Generate coverage data |
| 17 | tools/build/onos-prepare-sonar |
| 18 | |
| 19 | # Upload coverage to Sonar |
Ray Milkey | abba832 | 2017-11-08 12:03:58 -0800 | [diff] [blame] | 20 | sonar-scanner-$SONAR_SCANNER_VERSION/bin/sonar-scanner |
Ray Milkey | 20d2252 | 2017-11-08 10:55:52 -0800 | [diff] [blame] | 21 | |
| 22 | |