Slack integration for Synopsys Coverity on Polaris
The functionality of this script is to alert on new issues in any Polaris project that a service account has access to.
But you are in charge of running this script after your normal Polaris snapshot process.
You can configure which issues (eg only security or untriaged) are being reported.
Python version => 3.4
Versions of Python earlier than 3.4 needs asyncio, so you are going to need the backport package of that.
| VariableName | Type | Example |
|---|---|---|
| POLARIS_URL | Uri | http://example.cop.blackduck.com/ |
| POLARIS_TOKEN | string | examplepolaritoken |
| SLACK_WEBHOOK_URL | Uri | https://hooks.slack.com/services/XXXX/YYYY/zzzzz |
| POLARIS_FILTER_ONLY_SECURITY | Boolean | true (optional) |
| POLARIS_FILTER_ONLY_UNTRIAGED | Boolean | true (optional) |
docker build -t polaris-slack:example
docker run -e POLARIS_URL -e POLARIS_TOKEN -e SLACK_WEBHOOK_URL polaris-slack:examplepython3 -m venv venv
source venv/Scripts/activate
python3 -m pip install -r requirements.txt
python3 main.pypython3 -m venv venv
./venv/Scripts/Activate.ps1
python3 -m pip install -r requirements.txt
python3 main.py