diff --git a/.travis.yml b/.travis.yml index 9ace4eb88..b4a8fa5a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,8 @@ before_script: script: - ./manage.sh build - - ./manage.sh release - - docker build -t uxbox-backend backend/ - - docker build -t uxbox-frontend frontend/ + - ./manage.sh release-local + - ./manage.sh release-docker after_script: - docker images diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 68a52365a..0251c3dd8 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -69,6 +69,9 @@ RUN set -ex; \ scripts/figwheel.clj; \ npm install; \ npm run dist; \ + ./scripts/dist-main; \ + ./scripts/dist-view; \ + ./scripts/dist-worker; \ rm -rf ./dist/**/*.gz ./dist/**/*.br diff --git a/manage.sh b/manage.sh index f77d2e7b1..300906b14 100755 --- a/manage.sh +++ b/manage.sh @@ -34,7 +34,7 @@ function run_image { -p 3449:3449 -p 6060:6060 -p 9090:9090 $IMGNAME:$REV } -function release_image { +function release_local { cd frontend echo "Building frontend release..." rm -rf ./dist @@ -55,8 +55,20 @@ function release_image { cd .. } +function release_image { + echo "Building frontend release..." + rm -rf ./frontend/dist ./frontend/node_modules ./frontend/dist + sudo docker build --rm=true -t $IMGNAME-frontend:$REV frontend/ + echo "Frontend release image generated" + + echo "Building backend release..." + rm -rf ./backend/dist + sudo docker build --rm=true -t $IMGNAME-backend:$REV backend/ + echo "Backend release image generated" +} + function usage { - echo "USAGE: $0 [ build | run | release ]" + echo "USAGE: $0 [ build | run | release-local | release-docker ]" } case $1 in @@ -66,7 +78,10 @@ case $1 in run) run_image ;; - release) + release-local) + release_local + ;; + release-docker) release_image ;; *)