Removed nodeenv dependency

Once #106152 lands, nodejs will be available on our trusty build nodes,
so nodeenv is no longer strictly required. However, not everyone wants
to install nodejs on their system, so we now wrap the nodeenv
invocation into a script to test whether a local node exists. Since
we can no longer assume the existence of a clean virtual environment,
we also no longer install a global version of bower and grunt, and
instead use the versions bundled with the codebase's package.json.

Change-Id: I42f4b61037b8e988708b39e951dd2cddd99313b0
This commit is contained in:
Michael Krotscheck 2014-07-10 15:43:06 -07:00
parent ad453400de
commit 9db221c84f
3 changed files with 38 additions and 25 deletions

22
bin/nodeenv.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
# This script checks if node is installed in the current path,
# and if not, will install the version specified. using nodeenv -p
#
#command -v node && echo "ok"
ENVDIR="$1"
VERSION="$2"
if [[ $(command -v node) ]]
then
exit
fi
if [[ -n "$VERSION" ]]
then
nodeenv -p "$ENVDIR" --node="$VERSION"
else
nodeenv -p "$ENVDIR"
fi

View File

@ -34,7 +34,7 @@
"grunt-contrib-uglify": "0.2.7",
"grunt-contrib-imagemin": "0.4.0",
"grunt": "0.4.2",
"grunt-cli": "0.1.11",
"grunt-cli": "0.1.13",
"matchdep": "0.1.2",
"karma-script-launcher": "0.1.0",
"karma-chrome-launcher": "0.1.1",

39
tox.ini
View File

@ -3,47 +3,38 @@ minversion = 1.6
skipsdist = True
[testenv]
whitelist_externals = /bin/bash
whitelist_externals = bash
npm
node
nodejs
bower
grunt
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = nodeenv
MySQL-python
http://tarballs.openstack.org/storyboard/storyboard-master.tar.gz
[testenv:venv]
commands =
nodeenv -p {envdir} --node=0.10.26 || true
npm config set ca ""
npm install npm -g
npm config delete ca
pip install MySQL-python
npm install -g bower@1.3.8 grunt@0.4.2 grunt-cli@0.1.11
bash ./bin/nodeenv.sh {envdir} 0.10.29
npm install
bower install
{toxinidir}/node_modules/.bin/bower install --config.interactive=false
[testenv:grunt]
commands =
nodeenv -p {envdir} --node=0.10.26 || true
npm config set ca ""
npm install npm -g
npm config delete ca
pip install MySQL-python
npm install -g bower@1.3.8 grunt@0.4.2 grunt-cli@0.1.11
bash ./bin/nodeenv.sh {envdir} 0.10.29
npm install
bower install
{toxinidir}/node_modules/.bin/bower install --config.interactive=false
bash ./bin/api.sh create-db
bash ./bin/api.sh start
grunt {posargs}
{toxinidir}/node_modules/.bin/grunt {posargs}
bash ./bin/api.sh stop
[testenv:grunt_no_api]
deps = nodeenv
commands =
nodeenv -p {envdir} --node=0.10.26 || true
npm config set ca
npm install npm -g
npm config delete ca
pip install MySQL-python
npm install -g bower@1.3.8 grunt@0.4.2 grunt-cli@0.1.11
bash ./bin/nodeenv.sh {envdir} 0.10.29
npm install
bower install
grunt {posargs}
{toxinidir}/node_modules/.bin/bower install --config.interactive=false
{toxinidir}/node_modules/.bin/grunt {posargs}