From 1fa6bada4723fdb22734045fcb5acf1729a9883a Mon Sep 17 00:00:00 2001 From: ssube Date: Sun, 10 Nov 2019 09:59:58 -0600 Subject: [PATCH] feat(build): add sonar job --- .gitlab-ci.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19a8ad7..2c8b031 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,9 +11,9 @@ stages: # build jobs build-node: + stage: build extends: - .build-node - stage: build script: - make ci @@ -56,8 +56,8 @@ build-image-alpine-tag: IMAGE_ARCH: alpine build-image-stretch-branch: - extends: [.build-docker] stage: image + extends: [.build-docker] except: - tags script: @@ -66,9 +66,9 @@ build-image-stretch-branch: IMAGE_ARCH: stretch build-image-stretch-tag: + stage: image extends: - .build-docker - stage: image only: - tags script: @@ -78,11 +78,10 @@ build-image-stretch-tag: # publish jobs publish-npm: + stage: publish extends: - .build-node - stage: publish - only: - - tags + - .deploy-tags dependencies: - build-node @@ -120,24 +119,41 @@ codecov-success: - make upload-codecov github-pending: + stage: status-pre extends: - .build-curl - stage: status-pre script: - ./scripts/github-status.sh pending github-failure: + stage: status-post extends: - .build-curl - stage: status-post when: on_failure script: - ./scripts/github-status.sh failure github-success: + stage: status-post extends: - .build-curl - stage: status-post when: on_success script: - ./scripts/github-status.sh success + +sonar-success: + stage: status-post + extends: + - .build-sonar + + when: on_success + script: + - make node_modules + - sonar-scanner + -Dsonar.projectKey=ssube_salty-dog + -Dsonar.projectVersion=${CI_COMMIT_REF_SLUG} + -Dsonar.organization=ssube-github + -Dsonar.sources=src/,test/ + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.login=${SONAR_SECRET} + -Dsonar.typescript.lcov.reportPaths=out/coverage/lcov.info