Blame SOURCES/build_frontend.sh

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