2015-07-05 00:52:36 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-03-31 07:39:18 -07:00
|
|
|
if [[ "${CI_TARGET}" == lint ]]; then
|
2015-07-05 00:52:36 -07:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
|
|
|
brew update
|
|
|
|
fi
|
2015-09-22 05:36:15 -07:00
|
|
|
|
2017-09-09 07:44:38 -07:00
|
|
|
echo 'python info:'
|
|
|
|
(
|
|
|
|
2>&1 python --version || true
|
|
|
|
2>&1 python2 --version || true
|
|
|
|
2>&1 python3 --version || true
|
|
|
|
2>&1 pip --version || true
|
|
|
|
2>&1 pip2 --version || true
|
|
|
|
2>&1 pip3 --version || true
|
|
|
|
echo 'pyenv versions:'
|
|
|
|
2>&1 pyenv versions || true
|
|
|
|
) | sed 's/^/ /'
|
|
|
|
|
2016-12-27 15:44:36 -07:00
|
|
|
echo "Upgrade Python 2 pip."
|
2016-07-03 01:35:16 -07:00
|
|
|
pip2.7 -q install --user --upgrade pip
|
2015-09-22 05:36:15 -07:00
|
|
|
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
|
|
|
echo "Install Python 3."
|
|
|
|
brew install python3
|
2016-12-27 15:44:36 -07:00
|
|
|
echo "Upgrade Python 3 pip."
|
2016-07-03 01:35:16 -07:00
|
|
|
pip3 -q install --user --upgrade pip
|
2015-09-22 05:36:15 -07:00
|
|
|
else
|
2017-09-10 04:53:26 -07:00
|
|
|
echo "Upgrade Python 3 pip."
|
|
|
|
# Allow failure. pyenv pip3 on travis is broken:
|
|
|
|
# https://github.com/travis-ci/travis-ci/issues/8363
|
|
|
|
pip3 -q install --user --upgrade pip || true
|
2015-09-22 05:36:15 -07:00
|
|
|
fi
|
2017-11-28 23:50:11 -07:00
|
|
|
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" == linux ]]; then
|
|
|
|
echo "Install node (LTS)"
|
|
|
|
|
|
|
|
if [ ! -f ~/.nvm/nvm.sh ]; then
|
|
|
|
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
source ~/.nvm/nvm.sh
|
|
|
|
nvm install --lts
|
|
|
|
nvm use --lts
|
|
|
|
fi
|