From d334d7e355388603b3d8cc7404209987570582a1 Mon Sep 17 00:00:00 2001 From: Artyom Kazak Date: Fri, 25 Oct 2019 22:15:48 +0300 Subject: [PATCH] Ensure that the frontend is being built in production mode (#399) * Travis ensure that the frontend is being built in production mode --- .travis.yml | 2 +- Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d79e8c..cb5d86c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ jobs: - | if [ "$TRAVIS_EVENT_TYPE" = "push" ]; then export BRANCH="$(echo "$TRAVIS_BRANCH" | tr '/' '-')" - make front/travis-docker "tag=$BRANCH--front" + make front/travis-docker "tag=$BRANCH--front" || travis_terminate 1 docker login quay.io -u "$DOCKER_USER" -p "$DOCKER_PASS" docker push "quay.io/aelve/guide:$BRANCH--front" fi diff --git a/Makefile b/Makefile index 322ac45..b64e0fe 100644 --- a/Makefile +++ b/Makefile @@ -59,11 +59,12 @@ back/travis-docker: docker build docker/back -t quay.io/aelve/guide:$(tag) rm -rf docker/back/files -# Create a Docker image for the front; +# Create a Docker image for the front .PHONY: front/travis-docker front/travis-docker: rm -rf docker/front/files && mkdir docker/front/files cp -R front/dist docker/front/files/ cd ./docker/front/files/dist/ && export NODE_ENV=production && npm install + if grep -q "Vue in development mode" docker/front/files/dist/src/main.js; then echo "The frontend has been built in development mode"; exit 1; fi docker build docker/front -t quay.io/aelve/guide:$(tag) rm -rf docker/front/files