diff --git a/scripts/run-builder.sh b/scripts/run-builder.sh index 687b9b6..5cef707 100755 --- a/scripts/run-builder.sh +++ b/scripts/run-builder.sh @@ -35,6 +35,24 @@ echo "=== bee builder ===" echo "Builder: ${BUILDER_HOST}" echo "" +# --- check local repo is in sync with remote --- +cd "${REPO_ROOT}" +git fetch --quiet origin main +LOCAL=$(git rev-parse HEAD) +REMOTE=$(git rev-parse origin/main) +if [ "$LOCAL" != "$REMOTE" ]; then + echo "ERROR: local repo is not in sync with remote." + echo " local: $LOCAL" + echo " remote: $REMOTE" + echo "" + echo "Push or pull before building:" + echo " git push — if you have unpushed commits" + echo " git pull — if remote is ahead" + exit 1 +fi +echo "repo: in sync with remote ($LOCAL)" +echo "" + ssh -o StrictHostKeyChecking=no root@"${BUILDER_HOST}" /bin/sh <