#!/bin/bash # Stop on error set -e # Clone the munch-ease-frontend & munch-ease-backend repos # from https://git.jacobsthings.dynu.net/jacob/munch-ease-frontend.git # and https://git.jacobsthings.dynu.net/jacob/munch-ease-backend.git # respectively if [ -d ./munch-ease-frontend-buildartifact ]; then rm -rf ./munch-ease-frontend-buildartifact fi if [ -d ./munch-ease-backend-buildartifact ]; then rm -rf ./munch-ease-backend-buildartifact fi git clone https://git.jacobsthings.dynu.net/jacob/munch-ease-frontend.git ./munch-ease-frontend-buildartifact git clone https://git.jacobsthings.dynu.net/jacob/munch-ease-backend.git ./munch-ease-backend-buildartifact # Build the frontend via docker node:16 docker run -v "$(pwd)/munch-ease-frontend-buildartifact:/tmp/munch-ease/frontend" node:16 /bin/bash -c "cd /tmp/munch-ease/frontend && npm install && npm run build" # Build the container, setting the FRONTEND_DIR and BACKEND_DIR args docker build -t doof --build-arg FRONTEND_DIR=./munch-ease-frontend-buildartifact --build-arg BACKEND_DIR=./munch-ease-backend-buildartifact . if [ -d ./munch-ease-frontend-buildartifact ]; then rm -rf ./munch-ease-frontend-buildartifact fi if [ -d ./munch-ease-backend-buildartifact ]; then rm -rf ./munch-ease-backend-buildartifact fi