2018-04-14 20:50:01 +02:00
|
|
|
nvm install ${NODE_VERSION-v8.11.1}
|
2018-01-24 00:56:58 +01:00
|
|
|
|
|
|
|
# Travis sources this script, so we can export variables into the
|
|
|
|
# outer shell, so we don't want to set options like nounset because
|
|
|
|
# they would be set in the outer shell as well, so do as much logic as
|
|
|
|
# we can in a subshell.
|
|
|
|
(
|
2018-03-07 17:40:57 +01:00
|
|
|
set -o nounset -o errexit -o pipefail
|
2018-01-24 00:56:58 +01:00
|
|
|
[ -e "$(go env GOPATH)/bin" ] || mkdir -p "$(go env GOPATH)/bin"
|
|
|
|
|
|
|
|
YARN_VERSION="1.3.2"
|
|
|
|
DEP_VERSION="0.4.1"
|
|
|
|
GOMETALINTER_VERSION="2.0.3"
|
2018-04-15 01:43:48 +02:00
|
|
|
PIP_VERSION="10.0.0"
|
2018-04-02 03:54:57 +02:00
|
|
|
VIRTUALENV_VERSION="15.2.0"
|
2018-01-24 00:56:58 +01:00
|
|
|
AWSCLI_VERSION="1.14.30"
|
2018-03-01 03:38:08 +01:00
|
|
|
WHEEL_VERSION="0.30.0"
|
|
|
|
TWINE_VERSION="1.9.1"
|
2018-01-24 00:56:58 +01:00
|
|
|
|
|
|
|
OS=""
|
|
|
|
case $(uname) in
|
|
|
|
"Linux") OS="linux";;
|
|
|
|
"Darwin") OS="darwin";;
|
|
|
|
*) echo "error: unknown host os $(uname)" ; exit 1;;
|
|
|
|
esac
|
|
|
|
|
2018-04-12 20:07:49 +02:00
|
|
|
# On Travis, pip is called pip2.7, so alias it, also install jq
|
2018-01-24 00:56:58 +01:00
|
|
|
if [ "${TRAVIS_OS_NAME:-}" = "osx" ]; then
|
2018-02-24 18:28:55 +01:00
|
|
|
sudo ln -s $(which pip2.7) /usr/local/bin/pip
|
2018-04-12 20:07:49 +02:00
|
|
|
brew install jq
|
2018-01-24 00:56:58 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "installing yarn ${YARN_VERSION}"
|
|
|
|
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}
|
|
|
|
|
|
|
|
echo "installing dep ${DEP_VERSION}"
|
|
|
|
curl -L -o "$(go env GOPATH)/bin/dep" https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-${OS}-amd64
|
|
|
|
chmod +x "$(go env GOPATH)/bin/dep"
|
|
|
|
|
|
|
|
echo "installing Gometalinter ${GOMETALINTER_VERSION}"
|
|
|
|
curl -L "https://github.com/alecthomas/gometalinter/releases/download/v${GOMETALINTER_VERSION}/gometalinter-v${GOMETALINTER_VERSION}-${OS}-amd64.tar.bz2" | tar -jxv --strip-components=1 -C "$(go env GOPATH)/bin"
|
|
|
|
|
|
|
|
chmod +x "$(go env GOPATH)/bin/gometalinter"
|
|
|
|
chmod +x "$(go env GOPATH)/bin/linters/"*
|
|
|
|
|
|
|
|
# Gometalinter looks for linters on the $PATH, so let's move them out
|
|
|
|
# of the linters folder and into GOBIN (which we know is on the $PATH)
|
|
|
|
mv "$(go env GOPATH)/bin/linters/"* "$(go env GOPATH)/bin/."
|
|
|
|
rm -rf "$(go env GOPATH)/bin/linters/"
|
|
|
|
|
|
|
|
echo "installing gocovmerge"
|
|
|
|
|
|
|
|
# gocovmerge does not publish versioned releases, but it also hasn't been updated in two years, so
|
|
|
|
# getting HEAD is pretty safe.
|
|
|
|
go get -v github.com/wadey/gocovmerge
|
|
|
|
|
2018-04-15 01:43:48 +02:00
|
|
|
echo "upgrading Pip to ${PIP_VERSION}"
|
|
|
|
sudo pip install --upgrade "pip>=${PIP_VERSION}"
|
|
|
|
pip install --user --upgrade "pip>=${PIP_VERSION}"
|
|
|
|
|
2018-04-02 03:54:57 +02:00
|
|
|
echo "installing virtualenv ${VIRTUALENV_VERSION}"
|
2018-04-02 23:18:44 +02:00
|
|
|
sudo pip install "virtualenv==${VIRTUALENV_VERSION}"
|
2018-04-02 03:54:57 +02:00
|
|
|
pip install --user "virtualenv==${VIRTUALENV_VERSION}"
|
|
|
|
|
2018-01-24 00:56:58 +01:00
|
|
|
echo "installing AWS cli ${AWSCLI_VERSION}"
|
2018-02-24 18:28:55 +01:00
|
|
|
pip install --user "awscli==${AWSCLI_VERSION}"
|
2018-03-01 03:38:08 +01:00
|
|
|
|
|
|
|
echo "installing Wheel and Twine, so we can publish Python packages"
|
|
|
|
pip install --user "wheel==${WHEEL_VERSION}" "twine==${TWINE_VERSION}"
|
2018-01-24 00:56:58 +01:00
|
|
|
)
|
|
|
|
|
2018-04-02 20:47:27 +02:00
|
|
|
# If the sub shell failed, bail out now.
|
|
|
|
[ "$?" -eq 0 ] || exit 1
|
|
|
|
|
2018-01-24 00:56:58 +01:00
|
|
|
# By default some tools are not on the PATH, let's fix that
|
|
|
|
|
|
|
|
# On OSX, the user folder that `pip` installs tools to is not on the
|
|
|
|
# $PATH by default.
|
|
|
|
if [[ "${TRAVIS_OS_NAME:-}" == "osx" ]]; then
|
|
|
|
export PATH=$PATH:$HOME/Library/Python/2.7/bin
|
2018-03-01 03:38:08 +01:00
|
|
|
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
|
2018-01-24 00:56:58 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Add yarn to the $PATH
|
|
|
|
export PATH=$HOME/.yarn/bin:$PATH
|