2020-02-18 23:55:06 -05:00
|
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2020-05-21 02:11:19 -04:00
|
|
|
|
. "$DIR/.common.sh"
|
2020-02-18 23:55:06 -05:00
|
|
|
|
|
|
|
|
|
DOCKER_IMAGE=jc21/alpine-nginx-full:node
|
|
|
|
|
|
|
|
|
|
# Ensure docker exists
|
|
|
|
|
if hash docker 2>/dev/null; then
|
2020-06-02 20:30:29 -04:00
|
|
|
|
docker pull "${DOCKER_IMAGE}"
|
2020-02-18 23:55:06 -05:00
|
|
|
|
cd "${DIR}/.."
|
|
|
|
|
echo -e "${BLUE}❯ ${CYAN}Building Frontend ...${RESET}"
|
|
|
|
|
docker run --rm -e CI=true -v "$(pwd)/frontend:/app/frontend" -w /app/frontend "$DOCKER_IMAGE" sh -c "yarn install && yarn build && yarn build && chown -R $(id -u):$(id -g) /app/frontend"
|
|
|
|
|
echo -e "${BLUE}❯ ${GREEN}Building Frontend Complete${RESET}"
|
|
|
|
|
else
|
|
|
|
|
echo -e "${RED}❯ docker command is not available${RESET}"
|
|
|
|
|
fi
|