Skip to content
Concourse CI Resource for getting results from Sonarqube.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
.gitignore
Dockerfile
LICENSE
README.md
example-pipeline.yml
go.mod
renovate.json

README.md

SonarQube Notification Resource

Gets Sonarqube results.

Installing

Shortcut: Pipeline example

Use this resource by adding the following to the resource_types section of a pipeline config:

---
resource_types:
- name: sonarqube-notifier
  type: docker-image
  source:
    repository: lgohr/sonarqube
    tag: latest

Source configuration

Configure as follows:

---
resources:
- name: my-sonarqube
  type: sonarqube-notifier
  source:
    target: https://my.sonar.server
    sonartoken: ((my-secret-token))
    component: my:component
    metrics: ncloc,complexity,violations,coverage

in: Get the latest result

Get the latest result; write it to the local working directory (e.g. /tmp/build/get) with the filename result.json.

Example response (metrics: nloc,complexity,violations,coverage)

{
  "component": {
    "id": "AWH_6osdce3G0HojaCW1",
    "key": "my:component",
    "name": "my-component",
    "qualifier": "TRK",
    "measures": [
      {
        "metric": "ncloc",
        "value": "824",
        "periods": [
          {
            "index": 1,
            "value": "299"
          }
        ]
      },
      {
        "metric": "complexity",
        "value": "90",
        "periods": [
          {
            "index": 1,
            "value": "27"
          }
        ]
      },
      {
        "metric": "violations",
        "value": "5",
        "periods": [
          {
            "index": 1,
            "value": "-6"
          }
        ]
      },
      {
        "metric": "coverage",
        "value": "91.4",
        "periods": [
          {
            "index": 1,
            "value": "40.7"
          }
        ]
      }
    ]
  },
  "periods": [
    {
      "index": 1,
      "mode": "previous_version",
      "date": "2018-03-07T16:58:31+0100"
    }
  ]
}

out: Nothing

You can’t perform that action at this time.