2018-08-10 19:17:51 +03:00
|
|
|
steps:
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
2018-10-26 23:36:33 +03:00
|
|
|
echo "SYSTEM_PHASENAME=$SYSTEM_PHASENAME ARTIFACT_CLI=$ARTIFACT_CLI"
|
|
|
|
PYTHON_CONFIGURE_OPTS="--enable-shared"
|
2018-08-10 19:17:51 +03:00
|
|
|
if [ "${SYSTEM_PHASENAME}" == "Linux" ]; then
|
2018-10-12 00:24:38 +03:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev
|
2018-10-26 23:36:33 +03:00
|
|
|
elif [ "${SYSTEM_PHASENAME}" == "MacOS" ]; then
|
|
|
|
PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-openssl=$(brew --prefix openssl)"
|
2018-08-10 19:17:51 +03:00
|
|
|
fi
|
|
|
|
export PYENV_ROOT="$(Agent.WorkFolder)/.pyenv"
|
|
|
|
git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT
|
|
|
|
export PATH="$PYENV_ROOT/bin:$PATH"
|
|
|
|
pyenv --version
|
2018-10-26 23:36:33 +03:00
|
|
|
export PYTHON_CONFIGURE_OPTS
|
|
|
|
pyenv install $PYENV_VERSION
|
|
|
|
unset PYTHON_CONFIGURE_OPTS
|
2018-08-10 19:17:51 +03:00
|
|
|
pyenv global $PYENV_VERSION
|
|
|
|
echo "##vso[task.prependpath]$PYENV_ROOT/bin"
|
|
|
|
echo "##vso[task.prependpath]$PYENV_ROOT/shims"
|
|
|
|
displayName: Install Python
|
|
|
|
condition: and(succeeded(), ne(variables['ARTIFACT_CLI'], ''))
|