Update docker test scripts to support Node.js 6 and 10 buildings

This commit is contained in:
Daniel García Aubert
2018-10-31 17:20:25 +01:00
parent e57e548c31
commit b7b5f031f3
3 changed files with 51 additions and 5 deletions
+27 -2
View File
@@ -1,9 +1,34 @@
#!/bin/bash
usage() {
/etc/init.d/postgresql stop
echo "Usage: $0 [nodejs10|nodejs6]"
exit 1
}
echo "$0 $1"
# start PostgreSQL
/etc/init.d/postgresql start
echo "Node.js version:"
node -v
# install dependencies
npm install -g yarn@0.27.5
yarn
NODEJS_VERSION=${1-nodejs10}
if [ "$NODEJS_VERSION" = "nodejs10" ];
then
echo "Node.js version:"
npm -v
npm install
elif [ "$NODEJS_VERSION" = "nodejs6" ];
then
npm install -g yarn@0.27.5
yarn
else
usage
fi
# run tests
npm test