diff --git a/deploy.sh b/deploy.sh index 8d0dca2..76673e5 100644 --- a/deploy.sh +++ b/deploy.sh @@ -17,6 +17,17 @@ VERSION="$(sed -nE 's/^version *= *"([^"]+)".*/\1/p' Cargo.toml | head -1)" TAG="v${VERSION}" echo "==> Releasing ${SERVICE} ${TAG}" +# Check the tools before the 25-minute build, not after it. On Windows, plain +# `bash` from PowerShell is WSL, which usually has no docker; use Git Bash. +NEEDED="gcloud" +[[ "${SKIP_PUBLISH:-}" == "1" ]] || NEEDED="gcloud docker" +for tool in ${NEEDED}; do + if ! command -v "${tool}" >/dev/null 2>&1; then + echo "==> ${tool} not found in this shell. On Windows, run: & \"C:\\Program Files\\Git\\bin\\bash.exe\" deploy.sh" >&2 + exit 1 + fi +done + # Rebuild models image only when needed (export script or pip deps changed). # Normal code deploys skip this — models are already baked into shivvr-models:latest. if [[ "$1" == "--rebuild-models" ]]; then diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.md index 8f689c7..e6c6d61 100644 --- a/docs/OPERATIONS.md +++ b/docs/OPERATIONS.md @@ -94,6 +94,10 @@ With the tag's CI (gateway and `-cpu` images), that publishes all four images. I `deepbluedynamics` and `gcloud auth configure-docker`. `SKIP_PUBLISH=1 bash deploy.sh` stops after step 2. If the gateway isn't on Docker Hub yet, the script stops at step 4 and prints the two commands to finish by hand. +On Windows, run it with Git Bash (`& "C:\Program Files\Git\bin\bash.exe" deploy.sh` from PowerShell). Plain `bash` in +PowerShell starts WSL, which usually has no `docker`; the script checks for `gcloud` and `docker` before building and +stops with a message if either is missing. + --- ## Deploy