Dockerfile
FROM node:carbon
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
RUN npm install gulp -g
COPY . .
run gulp build --build
run npm test
EXPOSE 80
CMD [ "npm", "start" ]
Tests are ran using mocha --recursive
build.sh
docker build -t my-app .
echo $?
How can I detect that one mocha test fails, thus npm test
should not be ok, and neither docker build
?
I may have missed something in here.