# sonarqube-gate-check

> Launch SonarQube analysis and add a verification on the status of the Quality Gate after the report has ended

Latest version **0.0.4** (published 2019-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install sonarqube-gate-check
pnpm add sonarqube-gate-check
yarn add sonarqube-gate-check
bun add sonarqube-gate-check
```

Provides the command `sonarqube-verify`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2019-03-12 |
| First published | 2019-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | brunano21 |
| Maintainers | brunano21 |
| Keywords | sonarqube, quality, checker |

## Links

- npm: https://www.npmjs.com/package/sonarqube-gate-check
- Repository: https://github.com/brunano21/sonarqube-verify
- Homepage: https://github.com/brunano21/sonarqube-verify#readme
- Issues: https://github.com/brunano21/sonarqube-verify/issues
- npm.io page: https://npm.io/package/sonarqube-gate-check

## Dependencies (3)

- [slug](https://npm.io/package/slug.md) ^0.9.1
- [debug](https://npm.io/package/debug.md) ^3.1.0
- [sonarqube-scanner](https://npm.io/package/sonarqube-scanner.md) ^2.0.2

## Recent versions

- 0.0.4 (latest) — 2019-03-12
- 0.0.3 — 2019-03-12
- 0.0.2 — 2019-03-11
- 0.0.1 — 2019-03-11

## README

# sonarqube-gate-check
Launch SonarQube analysis using the sonarqube-scanner npm module by @bellingard : https://github.com/bellingard/sonar-scanner-npm then it check the Quality Gate status after report has ended.

Tested with [SonarQube 6.5](https://docs.sonarqube.org/display/SONAR/Documentation)

## Usage

### Installation
```
npm install -D sonarqube-gate-check
```

### Execution (CLI)
Insert a script into your package.json :
```
"scripts" : {
    "verify": "sonarqube-gate-check"
}
```

#### Configuration
You can use a sonar-project.properties file at your root folder.

Look at [Analysis Parameters](https://docs.sonarqube.org/display/SONAR/Analysis+Parameters) for available values.

#### Configuration (CLI)
Best practices are to not set critical settings in your repository.

For example committing the login token into your sonar-project.properties sould absolutely be avoided.

This module allows you to use the following environment variables to provide runtime parameters :
 - ```SONAR_URL``` : Url of your SonarQube server. Defaults to http://localhost:9000
 - ```SONAR_LOGIN``` : token or login (in latter case you must not set a password)
 - ```SONAR_PASSWORD``` : (in case you are not using authentication token but you should)
 - ```SONAR_SKIP``` : to disable the sonar analysis
 - ```SONAR_GATE_SKIP``` : in case you would like to disable the quality check.


#### Sample Configuration

```
sonar.sources=src
sonar.sourceEncoding=UTF-8
sonar.exclusions=**/node_modules/**
```

Then run the verify :
```
export SONAR_URL=http://myhost.com/sonar
export SONAR_LOGIN=01234567890123456
npm run verify
```

You can activate debug logs with the DEBUG environment variable (using the [debug package](https://github.com/visionmedia/debug)) :
```
DEBUG=* npm run verify
```

or more accurately :
```
DEBUG=sonarqube-gate-check:* npm run verify
```

---
_Source: https://npm.io/package/sonarqube-gate-check · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
