diff --git a/extras/centos-ci.sh b/extras/centos-ci.sh index 1a43f97c3..c89cb5575 100755 --- a/extras/centos-ci.sh +++ b/extras/centos-ci.sh @@ -6,7 +6,7 @@ # if anything fails, we'll abort set -e -REQ_GO_VERSION='1.8.3' +REQ_GO_VERSION='1.9.4' # install Go if ! yum -y install "golang >= $REQ_GO_VERSION" then @@ -24,8 +24,7 @@ yum -y install git mercurial bzr subversion gcc make curl -o /etc/yum.repos.d/glusterfs-nighthly-master.repo http://artifacts.ci.centos.org/gluster/nightly/master.repo yum -y install epel-release yum -y install glusterfs-server -yum -y install ShellCheck \ - etcd +yum -y install ShellCheck export GD2SRC=$GOPATH/src/github.com/gluster/glusterd2 cd "$GD2SRC" diff --git a/scripts/check-go.sh b/scripts/check-go.sh index 4988996ca..d26d43c52 100755 --- a/scripts/check-go.sh +++ b/scripts/check-go.sh @@ -1,7 +1,7 @@ #!/bin/bash REQ_GO_MAJOR_VERSION="1" -REQ_GO_MINOR_VERSION="8" +REQ_GO_MINOR_VERSION="9" REQ_GO_VERSION="$REQ_GO_MAJOR_VERSION.$REQ_GO_MINOR_VERSION" diff --git a/scripts/install-reqs.sh b/scripts/install-reqs.sh index 9ea947a52..6a6977ce7 100755 --- a/scripts/install-reqs.sh +++ b/scripts/install-reqs.sh @@ -4,7 +4,7 @@ GOPATH=$(go env GOPATH) GOBINDIR=$GOPATH/bin install_dep() { - DEPVER="v0.3.1" + DEPVER="v0.5.0" DEPURL="https://github.com/golang/dep/releases/download/${DEPVER}/dep-linux-amd64" type dep >/dev/null 2>&1 if [ $? -eq 0 ]; then @@ -39,5 +39,27 @@ install_gometalinter() { rm -f "$GOBINDIR/$LINTER_TARBALL" } +install_etcd() { + ETCD_VER="v3.3.9" + ETCD_TARBALL="etcd-${ETCD_VER}-linux-amd64.tar.gz" + ETCD_URL="https://github.com/coreos/etcd/releases/download/${ETCD_VER}/${ETCD_TARBALL}" + + type etcd >/dev/null 2>&1 + if [ $? -eq 0 ]; then + local version + version=$(etcd --version | awk '/^etcd Version/{print $3}') + if [[ $version == "$ETCD_VER" || $version > $ETCD_VER ]]; then + echo "etcd ${ETCD_VER} or greater is already installed" + return + fi + fi + + echo "Installing etcd. Version: ${ETCD_VER}" + curl -L -o "$GOBINDIR/$ETCD_TARBALL" $ETCD_URL + tar -zxf "$GOBINDIR/$ETCD_TARBALL" --overwrite --strip-components 1 -C "$GOBINDIR" --wildcards --no-anchored {etcd,etcdctl} + rm -f "$GOBINDIR/$ETCD_TARBALL" +} + install_dep install_gometalinter +install_etcd