sourcemaps
This commit is contained in:
1 parent
97743ea21c
commit
1aa264675e
11 files changed
+538
-17
No files matched your search
@@ -21,16 +21,27 @@ kubectl rollout status deployment/otel-debug-receiver -n monitoring
|
||||
|
||||
# Docker builds intentionally omit public source maps. If the public receiver
|
||||
# URL is present, build the same release locally and upload maps to the running
|
||||
# receiver. The Kubernetes source-map volume is currently
|
||||
# emptyDir, so upload after the rollout rather than before it.
|
||||
# receiver. Maps persist on the otel-sourcemaps PVC and are reloaded on start;
|
||||
# verify with: node scripts/dev-auth.mjs get /api/sourcemaps
|
||||
if [[ -n "${OTEL_URL:-}" ]]; then
|
||||
VITE_APP_RELEASE="$RELEASE" npm --prefix otel-ui run build
|
||||
# Take the maps from the exact UI build that went into the image (same
|
||||
# bundle hashes and positions as production), not from a second local build.
|
||||
maps_dir="$(mktemp -d)"
|
||||
trap 'rm -rf "$maps_dir"' EXIT
|
||||
docker build --target ui-builder \
|
||||
--build-arg "APP_RELEASE=${RELEASE}" \
|
||||
-t otel-debug-ui-builder:"${RELEASE}" .
|
||||
cid="$(docker create otel-debug-ui-builder:"${RELEASE}")"
|
||||
docker cp "$cid:/app/dist" "$maps_dir/dist"
|
||||
docker rm "$cid" >/dev/null
|
||||
found=0
|
||||
while IFS= read -r -d '' map; do
|
||||
found=1
|
||||
bundle="${map%.map}"
|
||||
RELEASE="$RELEASE" OTEL_URL="$OTEL_URL" \
|
||||
./scripts/upload-sourcemap.sh "$bundle"
|
||||
done < <(find otel-ui/dist -type f -name '*.js.map' -print0)
|
||||
find otel-ui/dist -type f -name '*.map' -delete
|
||||
done < <(find "$maps_dir" -type f -name '*.js.map' -print0)
|
||||
[[ "$found" == 1 ]] || { echo "no source maps found in UI build" >&2; exit 1; }
|
||||
fi
|
||||
|
||||
kubectl logs -f deployment/otel-debug-receiver -n monitoring
|
||||
Reference in new issue
Block a user