Changing init to sourced script for python nev

This commit is contained in:
Moritz Graf 2020-11-07 12:36:31 +01:00
parent 1850d95017
commit d71eb77f3a
1 changed files with 10 additions and 5 deletions

View File

@ -1,4 +1,8 @@
#!/bin/sh
# check whether script is sourced
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && echo "script is executed, but needs to be sourced" && exit 1
echo "######################################################################################"
echo "## Reinit repository"
rm -rf kubespray
@ -6,11 +10,12 @@ VERSION=${1:-release-2.14}
git clone --branch $VERSION https://github.com/kubernetes-sigs/kubespray.git
echo "######################################################################################"
echo "## Activating python3 venv"
VENVDIR=venv
virtualenv $VENVDIR
source $VENVDIR/bin/activate
pip install -r kubespray/requirements.txt
echo "## Activating pyenv venv"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv virtualenv 3.8.3 infrapuzzle-bootstrap
pyenv activate infrapuzzle-bootstrap
python -m pip install -r kubespray/requirements.txt
echo "######################################################################################"