CI: fail test in case building Docker image failed

This commit is contained in:
Simon Duquennoy 2018-06-05 15:11:32 +02:00
parent 0cee22fd71
commit 94398b0176
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,10 @@ before_install:
else
echo "Docker image changed, build from Dockerfile"
docker build tools/docker -t $DOCKER_IMG;
if [ $? != 0 ]; then
echo "Failed to build Docker image"
exit 1
fi
if [ $TRAVIS_SECURE_ENV_VARS == true ] && [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == 'develop' ]; then
echo "This build is for an update of branch develop. Push image to Dockerhub"
echo $DOCKERHUB_PASSWD | docker login --username contiker --password-stdin