Review README, extracting CONTRIBUTING

This commit is contained in:
Étienne BERSAC 2022-07-11 11:53:00 +02:00
parent 98e03e8b54
commit 3ac8570748
No known key found for this signature in database
GPG key ID: 95997557AD5A6DBF
3 changed files with 85 additions and 74 deletions

50
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,50 @@
# 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
watch the graphs in grafana. It's in `./test/vagrant`.
A vagrant file can be found in [this
repository](https://github.com/ioguix/vagrant-patroni to generate a patroni/etcd
setup.
## Executing Tests
The pytests are in `./test` and use a moker to provide a json response instead
of having to call the patroni API.

View file

@ -1,5 +1,13 @@
# check_patroni
A nagios plugin for patroni.
## Features
- Check presence of leader, replicas, node counts.
- Check each node for replication status.
```
Usage: check_patroni [OPTIONS] COMMAND [ARGS]...
@ -36,36 +44,24 @@ Commands:
## Install
Installation from the git repository:
check_patroni is licensed under PostgreSQL license.
```
$ git clone https://github.com/dalibo/check_patroni
```
Change the branch if necessary. Then create a dedicated environment,
install dependencies and then check_patroni from the repo:
```
$ cd check_patroni
$ python3 -m venv .venv
$ . .venv/bin/activate
(.venv) $ pip3 install .
(.venv) $ pip3 install .[dev] # for dev purposes
(.venv) $ pip3 install .[test] # for testing purposes
(.venv) $ check_patroni
```
To quit this env and destroy it:
```
$ deactivate
$ rm -r .venv
$ pip install git+https://github.com/dalibo/check_patroni.git
```
Links:
* [pip & centos 7](https://linuxize.com/post/how-to-install-pip-on-centos-7/)
* [pip & debian10](https://linuxize.com/post/how-to-install-pip-on-debian-10/)
## Support
If you hit a bug or need help, open a [GitHub
issue](https://github.com/dalibo/check_patroni/issues/new). Dalibo has no
commitment on response time for public free support. Thanks for you
contribution !
## Config file
All global and service specific parameters can be specified via a config file has follows:
@ -338,16 +334,3 @@ Options:
```
## test
The pytests are in `./test` and use a moker to provide a json response instead
of having to call the patroni API.
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
watch the graphs in grafana. It's in `./test/vagrant`.
A vagrant file can be found in [this
repository](https://github.com/ioguix/vagrant-patroni to generate a
patroni/etcd setup.

View file

@ -21,41 +21,36 @@ function helpme(){
cat << '_EOF_' > $README
# check_patroni
A nagios plugin for patroni.
## Features
- Check presence of leader, replicas, node counts.
- Check each node for replication status.
_EOF_
helpme
cat << '_EOF_' >> $README
## Install
Installation from the git repository:
check_patroni is licensed under PostgreSQL license.
```
$ git clone https://github.com/dalibo/check_patroni
```
Change the branch if necessary. Then create a dedicated environment,
install dependencies and then check_patroni from the repo:
```
$ cd check_patroni
$ python3 -m venv .venv
$ . .venv/bin/activate
(.venv) $ pip3 install .
(.venv) $ pip3 install .[dev] # for dev purposes
(.venv) $ pip3 install .[test] # for testing purposes
(.venv) $ check_patroni
```
To quit this env and destroy it:
```
$ deactivate
$ rm -r .venv
$ pip install git+https://github.com/dalibo/check_patroni.git
```
Links:
* [pip & centos 7](https://linuxize.com/post/how-to-install-pip-on-centos-7/)
* [pip & debian10](https://linuxize.com/post/how-to-install-pip-on-debian-10/)
## Support
If you hit a bug or need help, open a [GitHub
issue](https://github.com/dalibo/check_patroni/issues/new). Dalibo has no
commitment on response time for public free support. Thanks for you
contribution !
## Config file
All global and service specific parameters can be specified via a config file has follows:
@ -121,20 +116,3 @@ helpme node_tl_has_changed
cat << _EOF_ >> $README
_EOF_
cat << '_EOF_' >> $README
## test
The pytests are in `./test` and use a moker to provide a json response instead
of having to call the patroni API.
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
watch the graphs in grafana. It's in `./test/vagrant`.
A vagrant file can be found in [this
repository](https://github.com/ioguix/vagrant-patroni to generate a
patroni/etcd setup.
_EOF_