blob: c89756f987c27c4c32ec7ebeb876b8817dc9eb5e [file] [log] [blame]
#!/bin/bash -ex
# exit on errors
set -eu -o pipefail
ONOS_ROOT=`pwd`
. tools/build/envDefaults
# download and install Sonar scanner
SONAR_SCANNER_VERSION=3.0.3.778
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
unzip /tmp/sonar-scanner-cli.zip
# Configure ONOS specific properties
echo "sonar.host.url=https://sonar.onosproject.org" >>sonar-scanner-$SONAR_SCANNER_VERSION/conf/sonar-scanner.properties
# Be sure buck is installed
onos-buck --version
# Generate coverage data
tools/build/onos-prepare-sonar
# Upload coverage to Sonar
sonar-scanner-$SONAR_SCANNER_VERSION/bin/sonar-scanner