Created
July 1, 2022 23:38
-
-
Save lioneltchami/e9e5f25effe6d0d1fef6f377285dbde5 to your computer and use it in GitHub Desktop.
.gitlab-ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stages: | |
| - analyze | |
| analyze:sonar: | |
| stage: analyze | |
| image: | |
| name: sonarsource/sonar-scanner-cli:4.5 | |
| entrypoint: [""] | |
| variables: | |
| # Defines the location of the analysis task cache | |
| SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" | |
| # Shallow cloning needs to be disabled. | |
| # See https://docs.sonarqube.org/latest/analysis/gitlab-cicd/. | |
| GIT_DEPTH: 0 | |
| cache: | |
| key: "${CI_JOB_NAME}" | |
| paths: | |
| - .sonar/cache | |
| script: | |
| - sonar-scanner | |
| rules: | |
| # SonarQube CommunityEdition only supports analyzing a single branch. | |
| # So only run on master. | |
| - if: '$CI_COMMIT_BRANCH == "master"' | |
| when: on_success | |
| - when: never |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment