forked from affo/devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack
More file actions
29 lines (27 loc) · 1.01 KB
/
stack
File metadata and controls
29 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 $TOP_DIR/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
}