diff --git a/build-scripts/frontend-build-env/create_frontend.sh b/build-scripts/frontend-build-env/create_frontend.sh index 6e04549..05488db 100755 --- a/build-scripts/frontend-build-env/create_frontend.sh +++ b/build-scripts/frontend-build-env/create_frontend.sh @@ -73,9 +73,11 @@ BUILD_DIR=${BUILD_DIR:=$SCRIPTPATH} WORKSPACE=${BUILD_DIR:=$SCRIPTPATH}/hassio-frontend echo "[INFO] Checkout hass.io repository" -git clone "$REPOSITORY" "$WORKSPACE" -cd "$WORKSPACE" && git checkout "$BRANCH" -git submodule update --init --recursive + if [ ! -d "$WORKSPACE" ]; then + git clone "$REPOSITORY" "$WORKSPACE" + cd "$WORKSPACE" && git checkout "$BRANCH" + git submodule update --init --recursive +fi echo "[INFO] Start frontend build" docker stop $BUILD_CONTAINER_NAME 2> /dev/null || true diff --git a/build-scripts/frontend-build-env/run-build.sh b/build-scripts/frontend-build-env/run-build.sh index 7857d1a..6dc9c59 100755 --- a/build-scripts/frontend-build-env/run-build.sh +++ b/build-scripts/frontend-build-env/run-build.sh @@ -1,8 +1,15 @@ #!/bin/bash set -e +# install nvm +curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + # build frontend cd home-assistant-polymer +nvm install +nvm use yarn ./node_modules/.bin/bower install --allow-root yarn run frontend_prod