frontend-build 602 B

12345678910111213141516
  1. #!/bin/bash -e
  2. DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  3. . "$DIR/.common.sh"
  4. DOCKER_IMAGE=jc21/alpine-nginx-full:github-openresty-node
  5. # Ensure docker exists
  6. if hash docker 2>/dev/null; then
  7. cd "${DIR}/.."
  8. echo -e "${BLUE}❯ ${CYAN}Building Frontend ...${RESET}"
  9. 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"
  10. echo -e "${BLUE}❯ ${GREEN}Building Frontend Complete${RESET}"
  11. else
  12. echo -e "${RED}❯ docker command is not available${RESET}"
  13. fi