Merge pull request #72 from drnic/override-patroni-scope

allow $PATRONI_SCOPE to be set via 'docker run -e PATRONI_SCOPE=ironman'
This commit is contained in:
Oleksii Kliukin
2015-10-21 12:10:46 +02:00
+5 -5
View File
@@ -3,25 +3,25 @@
function usage()
{
cat <<__EOF__
Usage: $0
Usage: $0
Options:
--etcd ETCD Provide an external etcd to connect to
--name NAME Give the cluster a specific name
--name NAME Give the cluster a specific name
--etcd-only Do not run Patroni, run a standalone etcd
Examples:
$0 --etcd=127.17.0.84:4001
$0 --etcd-only
$0
$0
$0 --name=true_scotsman
__EOF__
}
DOCKER_IP=$(hostname --ip-address)
PATRONI_SCOPE=batman
PATRONI_SCOPE=${PATRONI_SCOPE:-batman}
optspec=":vh-:"
while getopts "$optspec" optchar; do
@@ -32,7 +32,7 @@ while getopts "$optspec" optchar; do
exec etcd --data-dir /tmp/etcd.data \
-advertise-client-urls=http://${DOCKER_IP}:4001 \
-listen-client-urls=http://0.0.0.0:4001 \
-listen-peer-urls=http://0.0.0.0:2380
-listen-peer-urls=http://0.0.0.0:2380
exit 0
;;
cheat)