Commit d5ef7a01 authored by Alexis POYEN's avatar Alexis POYEN
Browse files

Refactor : run CI in concurrency with coverage

parent 8e60e1b4
Pipeline #7082 failed
...@@ -17,38 +17,40 @@ variables: ...@@ -17,38 +17,40 @@ variables:
GIT_STRATEGY: clone GIT_STRATEGY: clone
GIT_DEPTH: 0 GIT_DEPTH: 0
stages: stages:
- sonar-analysis - build-and-test-with-sonar-concurrently
- build
build-master:
sonarqube: stage: build-and-test-with-sonar-concurrently
stage: sonar-analysis script:
image: skilldlabs/sonar-scanner:3.4.0 - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script: - DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE" .
- > - docker push "$CI_REGISTRY_IMAGE"
sonar-scanner only:
-Dsonar.projectName=${CI_PROJECT_NAME} - master
-Dsonar.projectVersion=1.0
-Dsonar.sourceEncoding=UTF-8 build:
-Dsonar.projectBaseDir=. stage: build-and-test-with-sonar-concurrently
-Dsonar.host.url=${SONAR_URL} script:
-Dsonar.projectKey=${SONAR_PROJECT_KEY} - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-Dsonar.login=${SONAR_TOKEN} - DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
build-master: except:
stage: build - master
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY sonarqube:
- DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE" . stage: build-and-test-with-sonar-concurrently
- docker push "$CI_REGISTRY_IMAGE" image: registry.forge.grandlyon.com/apoyen/sonnar-scanner-gl:master
only: script:
- master - go test ./... -coverprofile=coverage.out
- >
build: sonar-scanner
stage: build -Dsonar.projectName=${CI_PROJECT_NAME}
script: -Dsonar.projectVersion=1.0
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY -Dsonar.sourceEncoding=UTF-8
- DOCKER_BUILDKIT=1 docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . -Dsonar.projectBaseDir=.
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -Dsonar.host.url=${SONAR_URL}
except: -Dsonar.projectKey=${SONAR_PROJECT_KEY}
- master -Dsonar.login=${SONAR_TOKEN}
-Dsonar.go.coverage.reportPaths=./coverage.out
-Dsonar.exclusions=**/*_test.go
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment