зеркало из https://github.com/mozilla/treeherder.git
Bug 1318295 - Vagrant: Move virtualenv creation to shell provisioner
This commit is contained in:
Родитель
53bec2df44
Коммит
162975c420
|
@ -1,22 +1,12 @@
|
|||
class python {
|
||||
|
||||
exec {
|
||||
"create-virtualenv":
|
||||
cwd => "${HOME_DIR}",
|
||||
user => "${APP_USER}",
|
||||
command => "virtualenv ${VENV_DIR}",
|
||||
creates => "${VENV_DIR}",
|
||||
}
|
||||
|
||||
exec {"vendor-libmysqlclient":
|
||||
command => "${PROJ_DIR}/bin/vendor-libmysqlclient.sh ${VENV_DIR}",
|
||||
require => Exec["create-virtualenv"],
|
||||
user => "${APP_USER}",
|
||||
}
|
||||
|
||||
exec{"pip-install":
|
||||
require => [
|
||||
Exec['create-virtualenv'],
|
||||
Exec['vendor-libmysqlclient'],
|
||||
],
|
||||
user => "${APP_USER}",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
set -euo pipefail
|
||||
|
||||
SRC_DIR="$HOME/treeherder"
|
||||
VENV_DIR="$HOME/venv"
|
||||
ELASTICSEARCH_VERSION="2.3.5"
|
||||
|
||||
# Suppress prompts during apt-get invocations.
|
||||
|
@ -81,6 +82,11 @@ if [[ ! -f /usr/local/bin/virtualenv ]]; then
|
|||
sudo -H pip install virtualenv==15.0.1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$VENV_DIR" ]]; then
|
||||
echo '-----> Creating virtualenv'
|
||||
virtualenv "$VENV_DIR"
|
||||
fi
|
||||
|
||||
echo '-----> Initialising MySQL database'
|
||||
# The default `root@localhost` grant only allows loopback interface connections.
|
||||
mysql -u root -e 'GRANT ALL PRIVILEGES ON *.* to root@"%"'
|
||||
|
|
Загрузка…
Ссылка в новой задаче