check-patroni/vagrant/provision/check_patroni.bash
benoit d5adcd9db3 Add a cp_origin parameter in the Vagrantfile
* "test": use the local repository
* "origin": use the latest official release
2022-07-15 11:16:19 +02:00

35 lines
671 B
Bash
Executable file

#!/usr/bin/env bash
info (){
echo "$1"
}
ORIGIN=$1
set -o errexit
set -o nounset
set -o pipefail
info "#============================================================================="
info "# check_patroni"
info "#============================================================================="
DEBIAN_FRONTEND=noninteractive apt install -q -y git python3-pip
pip3 install --upgrade pip
case "$ORIGIN" in
"test")
cd /check_patroni
pip3 install .
ln -s /usr/local/bin/check_patroni /usr/lib/nagios/plugins/check_patroni
;;
"official")
pip3 install check_patroni
;;
*)
echo "Origin : [$ORIGIN] is not supported"
exit 1
esac
check_patroni --version