tooz/setup-etcd-env.sh
Davanum Srinivas f133259a09 Switch tests to use latest etcd - 3.1.3
Let's move on to newer releases of etcd. Especially since
3.1.x introduced some backwards incompatible changes

https://github.com/coreos/etcd/releases

Change-Id: I3887dbb745fb6de844c4b60d43b6543f441f239b
2017-03-14 15:17:42 +00:00

32 lines
724 B
Bash
Executable File

#!/bin/bash
set -eux
if [ -z "$(which etcd)" ]; then
ETCD_VERSION=3.1.3
case `uname -s` in
Darwin)
OS=darwin
SUFFIX=zip
;;
Linux)
OS=linux
SUFFIX=tar.gz
;;
*)
echo "Unsupported OS"
exit 1
esac
case `uname -m` in
x86_64)
MACHINE=amd64
;;
*)
echo "Unsupported machine"
exit 1
esac
TARBALL_NAME=etcd-v${ETCD_VERSION}-$OS-$MACHINE
test ! -d "$TARBALL_NAME" && curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${TARBALL_NAME}.${SUFFIX} | tar xz
export PATH=$PATH:$TARBALL_NAME
fi
$*