CartoDB-SQL-API/test/run_tests_docker.sh

41 lines
559 B
Bash
Raw Normal View History

#!/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
2018-04-27 22:38:36 +08:00
# install dependencies
NODEJS_VERSION=${1-nodejs10}
if [ "$NODEJS_VERSION" = "nodejs10" ];
then
echo "npm version on install:"
npm -v
npm ci
npm ls
elif [ "$NODEJS_VERSION" = "nodejs6" ];
then
echo "npm version on install:"
npm -v
npm i
npm ls
else
usage
fi
# run tests
echo "npm version on tests:"
npm -v
2018-04-27 23:40:13 +08:00
npm test