Giter Club home page Giter Club logo

gitlab-sonar-scanner-with-quality-gate's Introduction

Gitlab Sonar Scanner & Quality Gate

Continuous integration Security audit codecov Docker pull

Work inspired by ciricihq/gitlab-sonar-scanner

Using it in your gitlab projects

Add the next stage to your .gitlab-ci.yml.

stages:
- quality-gate

sonarqube:
  stage: quality-gate
  image: dcuenot/gitlab-sonar-scanner:1.0.0
  variables:
      SONAR_URL: https://your.sonarqube.server
      SONAR_LOGIN: "${SONAR_TOKEN}"
      SONAR_PROJECT_KEY: "${CI_PROJECT_NAME}"
      SONAR_PROJECT_NAME: "${CI_PROJECT_TITLE}"
  script:
    - gitlab-sonar-scanner
    - sonar_qg

If you need to add a specific configuration, you can also create a sonar-project.properties file.

Samples of output in Gitlab-CI

Output

Appending Sonar Quality Gate's result into your Merge Request

Prerequisite:

stages:
- quality-gate

sonarqube:
  stage: quality-gate
  image: dcuenot/gitlab-sonar-scanner:1.0.0
  variables:
      SONAR_URL: https://your.sonarqube.server
      SONAR_LOGIN: "${SONAR_TOKEN}"
      SONAR_PROJECT_KEY: "${CI_PROJECT_NAME}"
      SONAR_PROJECT_NAME: "${CI_PROJECT_TITLE}"
  script:
    - gitlab-sonar-scanner
    - sonar_qg --gitlab_personal_token "${GITLAB_PERSONAL_TOKEN}"

Output in Gitlab Merge Request

Merge Request Output

sonar_qg parameters

Sonar Quality Gate CLI 1.0.0

USAGE:
    sonar_qg [FLAGS] [OPTIONS] [report-task-path]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
    -v, --verbose    Verbose mode (-v, -vv, -vvv, etc.)

OPTIONS:
    -g, --gitlab_personal_token <gitlab-personal-token>     [env: GITLAB_PERSONAL_TOKEN=]

ARGS:
    <report-task-path>     [default: .scannerwork/report-task.txt]

License

All the code contained in this repository is licensed under a MIT License.

See LICENSE for more details

Contribution

All contribution are more than welcomed! If you need more information about contribution, details are in CONTRIBUTING.md

gitlab-sonar-scanner-with-quality-gate's People

Contributors

01123581321345589144233377 avatar dcuenot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gitlab-sonar-scanner-with-quality-gate's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.