cathive / concourse-sonarqube-resource

performs SonarQube analyses and checks quality gates https://concourse-ci.org/ https://sonarqube.org/
Apache License 2.0
46 stars 50 forks source link

Extend full example to show how to integrate sonarqube quality gate #9

Closed strimber closed 6 years ago

strimber commented 6 years ago

The full example attempts to demonstrate how to invoke cathive/concourse-sonarqube-qualitygate-task. This tasks takes an input of

headcr4sh commented 6 years ago

Ooops. Seems like I should have double-checked the example. The "concourse-sonarqube-quality-task" must be pointed to a directory that contains the result of the "in" action of the "concourse-sonarqube-resource".

It is therefore important to have 3 "matches" in your job definitions, which contains basically just an inline-task definition for the check of the quality gate:

- name: qualitygate
  plan:
  - get: code-analysis ### MATCH 1
    passed:
    - build-and-analyze
    trigger: true
  - task: check-sonarqube-quality-gate
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: cathive/concourse-sonarqube-qualitygate-task
          tag: latest # Use one of the versioned tags for reproducible builds!
      inputs:
      - name: code-analysis ### MATCH 2
      run:
        path: /sonarqube-qualitygate-check
        dir: code-analysis ### MATCH 3

... thus: if your resource has been specified under a different plan in your pipeline, you'll have to adjust these three spots.

I'll make sure to update the documentation to make it a bit clearer.

strimber commented 6 years ago

Excellent! Thank you for the quick response.

headcr4sh commented 6 years ago

Glad I could help. I am closing this issue. If anything else is unclear, feel free to open another one.