Skip to content

Commit

Permalink
added webhook screenshot to readme + minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
herlon214 committed Dec 5, 2021
1 parent cbeff2b commit 565d27c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ SONAR_ROOT_URL=https://sonar-url-without-trailing-slash
WEBHOOK_SECRET=my-hook-secret # Not necessary if CLI
```

There are currently two ways to use this project:
To generate a new Sonarqube API Key you can navigate to [https://your-sonar-url/account/security/](https://your-sonar-url/account/security/).

It's possible to use binary directly (check the releases page) OR using the docker container (more info below).


### Webhook
To see the list of all available commands in the server mode run with the `--help` flag:
Expand All @@ -60,6 +63,32 @@ $ sqpr server run
INFO[0000] Listening on port 8080
```

Now you can add the Webhook into the Sonarqube admin panel using the the `/webhook` endpoint:

![Webhook demo](assets/webhook_screenshot.png)

[!] The **secret** here needs to match the env var `WEBHOOK_SECRET`.

### Using docker
You can also use the docker image instead of running the binary manually:

```yaml
// docker-compose.yml
version: "3"

services:
webhook:
image: herlon214/sonarqube-pr-issues:v0.1.6 # Check the latest version
restart: always
environment:
SONAR_API_KEY: my-sonar-api-key
GH_TOKEN: my-github-token
SONAR_ROOT_URL: https://sonar-url-without-trailing-slash
WEBHOOK_SECRET: my-hook-secret
ports:
- 8080
```
### CLI
This option is mostly to test, ideally you should use the webhook.
Expand Down
Binary file added assets/webhook_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 565d27c

Please sign in to comment.