Skip to content

Commit

Permalink
Merge pull request #3 from t-cas/fix-sonar-build
Browse files Browse the repository at this point in the history
fix failing build due to sonar setup
  • Loading branch information
t-cas authored Jun 10, 2017
2 parents b68a3fd + 4f25922 commit 7c6b145
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# required for sonar (https://docs.travis-ci.com/user/sonarqube/)
dist: trusty

# required for docker and sonar
sudo: required

language: python

services:
- docker

addons:
sonarqube:
organization: "default"
token:
secure: "qv53nBqeaawK1/ZOj5IyLzqA/QsIQnPkuDa0D75i9jqUgSnNhCMMSoBUAqwikDQYJ+TO6+xW0GjcAKZJ/eYaWN+++DvSopv+WCwKoRKsCJUpcF8XGnfes9iux+8eYYCL0uQRtiJdbJ/I50Xp6jrOrF+98b8CGwa6DAfqxNu4FyteKe/dswtOlbH/2iBN5tJTh5/3pKIbhrzuRznbqqa7HeBU9OrMAEz7t4kJEO+TDV7WkOGQPntL/t1CSPla7w2PeNfWYVm1DiSTFaCuSmhYqA5gX+uCiPgC1aAXkv3NxlrkAIOXbj1LfUKR6TePYk6dz+e+thgnT7X2ohA/vMDOngoDTTK+2uycd5qS7PTENfc3628REANIiJUXWtUZRb3hPeRQFoj7rwDvHqtlj56RK9r2uz1M5cVX+v9ZtfS1JSYeK/iG6BDceYOSRK8Ih6QZUiJFdzMrYiHKUony1VkpBZ0pOrG5ph0dclwFaLGSKn6usyvScUdFbtxUm6JT4XGvvLAEASz4+UVOvSMF384BtDCRR/hc0rY2IH49liwcm5RSJ6pGKMZEfKZyYG5BQE6jpD409WUqR4vNuJbbAyRWQ5aTruLbshIBsVuUJlM2CmG7wBmkkMg2P4PB1HwlFn6ZEfy+j5zB0bpCZQKeW1KcukZRrKBHUpQYRvox/btarL8="

python: 3.6
env:
matrix:
Expand All @@ -24,12 +31,6 @@ env:
global:
# GITHUB_TOKEN
- secure: "Br8mZxiBxGB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hPeRQFoj7rwDvHqtlj56RK9r2uz1M5cVX+v9ZtfS1JSYeK/iG6BDceYOSRK8Ih6QZUiJFdzMrYiHKUony1VkpBZ0pOrG5ph0dclwFaLGSKn6usyvScUdFbtxUm6JT4XGvvLAEASz4+UVOvSMF384BtDCRR/hc0rY2IH49liwcm5RSJ6pGKMZEfKZyYG5BQE6jpD409WUqR4vNuJbbAyRWQ5aTruLbshIBsVuUJlM2CmG7wBmkkMg2P4PB1HwlFn6ZEfy+j5zB0bpCZQKeW1KcukZRrKBHUpQYRvox/btarL8="
#
- SONAR_HOST_URL="https://sonarcloud.io"
- SONAR_ORGA="default"

install:
- pip install tox coveralls
Expand Down
9 changes: 1 addition & 8 deletions .travis/runSonarQubeAnalysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ set -e
# SOURCE: https://github.com/bellingard/multi-language-project/blob/master/runSonarQubeAnalysis.sh
#

# This assumes that the 2 following variables are defined:
# - SONAR_HOST_URL => should point to the public URL of the SQ server (e.g. for Nemo: https://nemo.sonarqube.org)
# - SONAR_TOKEN => token of a user who has the "Execute Analysis" permission on the SQ server

# We don't want to run X times the same analysis because of the matrix configuration
if [ "${TOX_ENV}" != "pypy" ]; then
echo "Duplicated run detected, skipping the SonarQube analysis... (currently running ${TOX_ENV})"
Expand All @@ -24,7 +20,7 @@ if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ];
#
# Analysis is done only on master so that build of branches don't push analyses to the same project and therefore "pollute" the results
echo "Starting analysis by SonarQube..."
sonar-scanner -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=$SONAR_ORGA
sonar-scanner


elif [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ -n "${GITHUB_TOKEN-}" ]; then
Expand All @@ -36,9 +32,6 @@ elif [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ -n "${GITHUB_TOKEN-}" ]; then
# That's why the analysis does not need to be executed if the variable GITHUB_TOKEN is not defined.
echo "Starting Pull Request analysis by SonarQube..."
sonar-scanner \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.organization=$SONAR_ORGA \
-Dsonar.analysis.mode=preview \
-Dsonar.github.oauth=$GITHUB_TOKEN \
-Dsonar.github.repository=$TRAVIS_REPO_SLUG \
Expand Down

0 comments on commit 7c6b145

Please sign in to comment.