Added change directory to move process back to hydroshare
@@ -421,14 +421,25 @@ reset_all_hs() {
}
dis_build() {
-# Start Docker container and Run build
+#### Set version pin variable ####
+n_ver="15.0.0"
+#n_ver="14.14.0"
-docker run -i -v $HS_PATH:/hydroshare --name=nodejs node:latest /bin/bash << eof
+echo "Starting Node Build .... "
-cd hydroshare
+### Create Directory structure outside to maintain correct permissions
cd hs_discover
rm -rf static templates
-mkdir -p static templates/hs_discover
+mkdir static templates
+mkdir templates/hs_discover
+mkdir static/js
+mkdir static/css
+
+# Start Docker container and Run build
+docker run -i -v $HS_PATH:/hydroshare --name=nodejs node:$n_ver /bin/bash << eof
+
+cd hydroshare
+cd hs_discover
npm install
npm run build
mkdir -p static/js
@@ -448,7 +459,11 @@ mv js/chunk-vendors.*.js js/chunk-vendors.js
cd ..
eof
+echo "Node Build completed ..."
+echo
+echo "Removing node container"
docker container rm nodejs
+cd $HS_PATH
sleep 1
}
