Git Product home page Git Product logo

bb-sonar-stats's Introduction

Sonarqube statistics bitbucket application

Build Status Quality Gate Status

This app shows Sonarqube statistics from SonarQube servers or SonarCloud.

sonar_preview

Table of Contents

  1. About
  2. Bitbucket-app-registration
  3. Running
  4. Building
  5. Configuration

About

This app shows SonarQube statistics for Bitbucket repositories like test code issues, test coverage, code duplication. This app also highlights the failed quality gates. All metrics are linked to SonarQube's Web UI. It works with public and private SonarQube servers (tested with sonar server 7.9.4 ) and possibly SonarCloud (not tested yet).

Please note that in order to have this app available in all repositories of your team, you have to install it on the team account.

Bitbucket-app-registration

  1. Go to your bitbucket organization/account settings
  2. OAuth consumers - Add consumer
  3. Fill in details, check This is a private consumer checkbox, choose scopes: account: read, repositories: read
  4. Save oauth key and secret
  5. Go to Installed apps, enable Development mode
  6. Go to Develop apps - Register app, enter app url, register app
  7. Click on installation url and grant access to the app

Running

  1. Prepare config.toml file.
  2. docker pull 1node/bb-sonar-stats:latest
  3. docker run -itd -v </path/to/config.toml>/config.toml:/app/config.toml -p <app_port>:9001 1node/bb-sonar-stats:latest

config.toml example:

baseUrl = https://bb-sonar-stats.1node.xyz
port = 8080
logLevel = "info"
organization = "1node"

bitbucketOauthKey = <bitbucket oauth key>
bitbucketOauthSecret = <bitbucket oauth secret>

sonarConfigPath = "sonar.json"
Key Value description
baseUrl Domain mapped to your application.
port Port on which your application listening.
logLevel Logging level. Possible values: debug, info, warning, error, fatal, panic.
organization Your organization name. You need to fill in this field to make bitbucket app descriptor unique.
bitbucketOauthKey Bitbucket oauth key from oauth key registration.
bitbucketOauthSecret Bitbucket oauth secret from oauth key registration.
sonarConfigPath Path to sonar.json in your repo. By default application waiting for this file in the repo root.

Building

  1. git clone repo, cd repo
  2. docker build -t 1node/bb-sonar-stats:latest -f ./docker/Dockerfile .

Configuration

This app needs a configuration file called "sonar.json" in the root of the main (default) branch of the Bitbucket repository. This file must contain the Sonarqube server or Sonarcloud URL, the project key of Sonar project which should be associated with this repository and token for account that have access to sonarqube project (or without token if sonar peoject is public). Example:

{
    "server": "https://sonar.domain.tld",
    "project_key": "My-Awesome-Project",
    "token": "sonarToken"
}

bb-sonar-stats's People

Contributors

1k-off avatar

Watchers

 avatar

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.