2022-07-11 11:53:00 +02:00
|
|
|
# Contributing to check_patroni
|
|
|
|
|
|
|
|
Thanks for your interest in contributing to check_patroni.
|
|
|
|
|
|
|
|
## Clone Git Repository
|
|
|
|
|
|
|
|
Installation from the git repository:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ git clone https://github.com/dalibo/check_patroni.git
|
|
|
|
$ cd check_patroni
|
|
|
|
```
|
|
|
|
|
|
|
|
Change the branch if necessary.
|
|
|
|
|
|
|
|
## Create Python Virtual Environment
|
|
|
|
|
|
|
|
You need a dedicated environment, install dependencies and then check_patroni
|
|
|
|
from the repo:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ python3 -m venv .venv
|
|
|
|
$ . .venv/bin/activate
|
|
|
|
(.venv) $ pip3 install .[dev,test]
|
|
|
|
(.venv) $ check_patroni
|
|
|
|
```
|
|
|
|
|
|
|
|
To quit this env and destroy it:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ deactivate
|
|
|
|
$ rm -r .venv
|
|
|
|
```
|
|
|
|
|
|
|
|
## Development Environment
|
|
|
|
|
|
|
|
A vagrant file is available to create a icinga / opm / grafana stack and
|
|
|
|
install check_patroni. You can then add a server to the supervision and
|
2022-07-11 12:32:20 +02:00
|
|
|
watch the graphs in grafana. It's in the `vagrant` directory.
|
2022-07-11 11:53:00 +02:00
|
|
|
|
|
|
|
A vagrant file can be found in [this
|
|
|
|
repository](https://github.com/ioguix/vagrant-patroni to generate a patroni/etcd
|
|
|
|
setup.
|
|
|
|
|
2022-07-11 12:34:40 +02:00
|
|
|
The `README.md` can be geneated with `./docs/make_readme.sh`.
|
|
|
|
|
2022-07-11 11:53:00 +02:00
|
|
|
|
|
|
|
## Executing Tests
|
|
|
|
|
2022-07-11 12:36:04 +02:00
|
|
|
The pytests are in `./tests` and use a moker to provide a json response instead
|
2022-07-11 11:53:00 +02:00
|
|
|
of having to call the patroni API.
|