Blame SOURCES/build_frontend.sh

710871
#!/bin/bash -eu
710871
b1b385
# Revert upstream change: "rename plugin IDs from pcp-*-* to performancecopilot-*-*"
b1b385
# https://github.com/performancecopilot/grafana-pcp/commit/70ca5cc307e231cea14281e1cd2268ae4f1f445c
b1b385
# This change would break all existing custom dashboards. Using sed here instead of a patch
b1b385
# to catch all future usage of the new upstream plugin ids.
b1b385
find src cypress \( -name '*.ts' -o -name '*.json' -o -name '*.jsonnet' -o -name '*.libsonnet' \) \
b1b385
  -exec sed -i \
b1b385
  -e 's/performancecopilot-redis-datasource/pcp-redis-datasource/g' \
b1b385
  -e 's/performancecopilot-vector-datasource/pcp-vector-datasource/g' \
b1b385
  -e 's/performancecopilot-bpftrace-datasource/pcp-bpftrace-datasource/g' \
b1b385
  -e 's/performancecopilot-flamegraph-panel/pcp-flamegraph-panel/g' \
b1b385
  -e 's/performancecopilot-breadcrumbs-panel/pcp-breadcrumbs-panel/g' \
b1b385
  -e 's/performancecopilot-troubleshooting-panel/pcp-troubleshooting-panel/g' \
b1b385
  {} \;
b1b385
710871
# Build the frontend
710871
yarn run build
710871
710871
# Build the dashboards
710871
make build-dashboards
710871
710871
# Fix permissions (webpack sometimes outputs files with mode = 666 due to reasons unknown (race condition/umask issue afaics))
710871
chmod -R g-w,o-w dist