diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d69b2e5a7446cd132dbb6c3c36d171f03dd31d1f..2b976a3d0e0933dd4aa0ddf5417cda8168acb7d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,18 @@ test: protoc/bin/protoc --proto_path=api/proto/v1 --proto_path=third_party --go_out=plugins=grpc:pkg/api/v1 config-service.proto go test ./... +sonar: + stage: test + image: + name: sonarsource/sonar-scanner-cli:latest + entrypoint: [""] + only: + - develop + - /^release/ + script: + - sonar-scanner -Dsonar.host.url=${SONAR_HOST} -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.projectName=${SONAR_PROJECT_NAME} -Dsonar.branch.name=${CI_COMMIT_BRANCH} -Dsonar.login=${SONAR_LOGIN_TOKEN} + allow_failure: true + build_and_push_latest_image: stage: build only: diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000000000000000000000000000000000000..269a37e8180b6b5e9e348cd6fe2fc6ee9576d534 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,15 @@ +# must be unique in a given SonarQube instance +#sonar.projectKey=my:project + +# --- optional properties --- + +# defaults to project key +#sonar.projectName=My project +# defaults to 'not provided' +#sonar.projectVersion=1.0 + +# Path is relative to the sonar-project.properties file. Defaults to . +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 \ No newline at end of file