Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-13754

Add a tutorial for GitLab CI/CD after the GitLab onboarding

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.5
    • Component/s: Branch & PR
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      The tutorial can entirely be copied from SonarCloud, with few adjustments:

      • SONAR_HOST and SONAR_TOKEN should be masked but unprotected (because by default on gitlab.com branches and PRs are not protected)
      • the¬†sonar-project.properties file should be created before the .gitlab-ci.yml file ( to not fail the pipeline with a missing project key). So step 2 & 3 should be inverted
         
      sonarqube-check:
        image:
          name: sonarsource/sonar-scanner-cli:latest
        variables:
          SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
          GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the analysis task
        script:
          - sonar-scanner -Dsonar.qualitygate.wait=true
        allow_failure: true
        cache:
          key: ${CI_JOB_NAME}
          paths:
            - .sonar/cache
        only:
          - merge_requests
          - master
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jeremy.davis Jeremy Davis
              Reporter:
              pierre.guillot Pierre Guillot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: