Virtual environment groundwork

Introduce the tooling to build virtual environments.
* tools/build_venv.sh: build a venv
* introduce lib/stack to house functionality extracted from stack.sh that
 is needed in other places, such as Grenade; start with stack_install_service
 to wrap the venv install mechanics
* declare PROJECT_VENV array to track where project venvs should be installed
* create a venv for each project defined in PROJECT_VENV in stack_install_service()
Change-Id: I508588c0e2541b976dd94569d44b61dd2c35c01c
This commit is contained in:
Dean Troyer
2015年02月18日 14:47:54 -06:00
parent b1d8e8e274
commit 8c2ce6ea72

29
lib/stack Normal file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
#
# lib/stack
#
# These functions are code snippets pulled out of stack.sh for easier
# re-use by Grenade. They can assume the same environment is available
# as in the lower part of stack.sh, namely a valid stackrc has been sourced
# as well as all of the lib/* files for the services have been sourced.
#
# For clarity, all functions declared here that came from ``stack.sh``
# shall be named with the prefix ``stack_``.
# Generic service install handles venv creation if confgured for service
# stack_install_service service
function stack_install_service {
local service=1ドル
if type install_${service} >/dev/null 2>&1; then
if [[ -n ${PROJECT_VENV[$service]:-} ]]; then
rm -rf ${PROJECT_VENV[$service]}
source tools/build_venv.sh ${PROJECT_VENV[$service]}
export PIP_VIRTUAL_ENV=${PROJECT_VENV[$service]:-}
fi
install_${service}
if [[ -n ${PROJECT_VENV[$service]:-} ]]; then
unset PIP_VIRTUAL_ENV
fi
fi
}
Reference in New Issue
openstack/devstack
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.