commit | 492d8bc11a5138cdd942da04b44ee09fabab994a | [log] [tgz] |
---|---|---|
author | Michal Kobus <mkobus@mirantis.com> | Mon Feb 15 16:54:13 2021 +0100 |
committer | Michal Kobus <mkobus@mirantis.com> | Wed Jun 16 13:02:36 2021 +0000 |
tree | 14cee4d5969614aac967a6f6508b5f33d66bd5b2 | |
parent | 3861b93666181d7294913f8f8233dd7597382aea [diff] |
Rewritten code to Python 3 - Docker baseimage change to alpine - bumped all deps - skip testing till py36 is available in CI Change-Id: I7b0ca2b28e2c639645ea07e2b3adb21b857b2fe5 Related-PROD: PRODX-11711 Related-PROD: PRODX-14584
Prometheus Alertmanager webhook receiver sending alert notification to Salesforce.
Install Python dependencies:
$ virtualenv venv -p python3 $ source venv/bin/activate (venv)$ source sf_notifier/vars/development (venv)$ pip install --upgrade pip (venv)$ pip install -e .
Add to settings/development.py
credentials for your Salesforce customer (not engineering) account:
SF_CONFIG = { 'AUTH_URL': 'xxx', 'USERNAME': 'xxx', 'PASSWORD': 'xxx', 'ORGANIZATION_ID': 'xxx', 'ENVIRONMENT_ID': 'xxx', 'SANDBOX_ENABLED': True }
You may also specify environment variables to override Python settings:
export SFDC_AUTH_URL="xxx" export SFDC_USERNAME="xxx" export SFDC_PASSWORD="xxx" export SFDC_ORGANIZATION_ID="xxx" export SFDC_ENVIRONMENT_ID="xxx" export SFDC_SANDBOX_ENABLED=true
Run server:
(venv)$ uwsgi --http 127.0.0.1:5000 --wsgi-file sf_notifier/server.py --callable app_dispatch
Check in browser:
http://127.0.0.1:5000/metrics