Created
May 9, 2016 17:04
-
-
Save leoh0/21d61d3bebe394d278e6f18d5465415d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| sudo apt-get install -qqy git make build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
| libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ | |
| libncursesw5-dev libxml2-dev libxslt1-dev libffi-dev | |
| curl -sL https://raw.github.com/yyuu/pyenv-installer/master/bin/pyenv-installer | \ | |
| bash | |
| export PATH="~/.pyenv/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| eval "$(pyenv virtualenv-init -)" | |
| echo 'export PATH="~/.pyenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(pyenv init -)"' >> ~/.bashrc | |
| echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc | |
| PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4" ~/.pyenv/bin/pyenv install 2.7.9 | |
| ~/.pyenv/bin/pyenv global 2.7.9 | |
| cat << OPENRC_CHOOSER > ~/.pyenv/pyenv.d/exec/openstack.bash | |
| openstack_root=\$(pwd -P 2>/dev/null || command pwd) | |
| while [ ! -e "\$openstack_root/openrc" ]; | |
| do | |
| openstack_root=\${openstack_root%/*} | |
| if [ "\$openstack_root" == "" ]; then | |
| break | |
| fi | |
| done | |
| if [ "\$openstack_root" != "" ]; then | |
| while read var; do unset "\$var"; done< <(env | awk -F= '/^OS_/{print \$1}') | |
| . "\$openstack_root/openrc" | |
| fi | |
| OPENRC_CHOOSER | |
| echo 'need relogin' | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment