set -eo pipefail
-# Get the wb2 repository
+# Get the arvados repository
cd /usr/src
-sudo git clone https://git.arvados.org/arvados-workbench2.git
+sudo git clone https://git.arvados.org/arvados.git
+cd arvados/services/workbench2
+
+if [[ "$GIT_HASH" != "" ]]; then
+ echo "GIT_HASH is set to $GIT_HASH, checking out that revision..."
+ sudo git checkout $GIT_HASH
+fi
+
+# React uses a lot of filesystem watchers (via inotify). Increase the default
+# so we have a higher limit at runtime.
+echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
+sudo sysctl -p
# Build the workbench2-build docker image
-cd arvados-workbench2
sudo make workbench2-build-image
-cd ..
-sudo rm -rf arvados-workbench2
+cd ../../../
+sudo rm -rf arvados