chore(release): verify remote backend artifact

This commit is contained in:
2026-07-14 22:19:52 +08:00
parent 5f8dc82462
commit 442082bfc9
3 changed files with 15 additions and 1 deletions
+12
View File
@@ -120,6 +120,18 @@ if [[ -n "${RELEASE_REMOTE_URL:-}" ]]; then
[[ "$remote_frontend_sha256" == "$local_frontend_sha256" ]] || fail "remote frontend asset does not match local build"
[[ "$remote_mobile_sha256" == "$local_mobile_sha256" ]] || fail "remote mobile H5 asset does not match local build"
echo "remote_asset_match=true"
if [[ "${RELEASE_VERIFY_REMOTE_BACKEND:-false}" == "true" ]]; then
command -v ssh >/dev/null 2>&1 || fail "ssh is required for remote backend verification"
remote_ssh="${RELEASE_REMOTE_SSH:-YCWY}"
remote_backend_path="/opt/wygj/app/ruoyi-admin.jar"
remote_backend_sha256="$(ssh -o BatchMode=yes -o ConnectTimeout=10 "$remote_ssh" "sha256sum '$remote_backend_path'" | awk '{print $1}')" || fail "remote backend hash check failed: $remote_ssh:$remote_backend_path"
[[ "$remote_backend_sha256" =~ ^[0-9a-f]{64}$ ]] || fail "remote backend hash is invalid: $remote_ssh:$remote_backend_path"
local_backend_sha256="$(sha256 "$backend_jar")"
echo "remote_backend_sha256=$remote_backend_sha256"
[[ "$remote_backend_sha256" == "$local_backend_sha256" ]] || fail "remote backend jar does not match local build"
echo "remote_backend_match=true"
fi
fi
fi