# What this PR does
provide command to serve local dist folder without running local Grafana
## Checklist
- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
show up in the autogenerated release notes.
43 lines
No EOL
1.1 KiB
Text
43 lines
No EOL
1.1 KiB
Text
label = "OnCall.Plugin"
|
|
|
|
is_ci=config.tilt_subcommand == "ci"
|
|
grafana_plugin_dir="../../grafana-plugin"
|
|
|
|
# On CI dependencies are installed separately so we just build prod bundle to be consumed by Grafana dev server
|
|
if is_ci:
|
|
local_resource(
|
|
"build-ui",
|
|
labels=[label],
|
|
dir=grafana_plugin_dir,
|
|
cmd="pnpm build",
|
|
allow_parallel=True,
|
|
)
|
|
|
|
# Locally we install dependencies and we run watch mode
|
|
if not is_ci:
|
|
local_resource(
|
|
"build-ui",
|
|
labels=[label],
|
|
dir=grafana_plugin_dir,
|
|
cmd="pnpm install",
|
|
serve_dir=grafana_plugin_dir,
|
|
serve_cmd="pnpm dev",
|
|
allow_parallel=True,
|
|
)
|
|
|
|
local_resource(
|
|
'build-oncall-plugin-backend',
|
|
labels=[label],
|
|
dir="../../grafana-plugin",
|
|
cmd="mage buildAll",
|
|
deps=['../../grafana-plugin/pkg/plugin']
|
|
)
|
|
|
|
local_resource(
|
|
'restart-oncall-plugin-backend',
|
|
labels=[label],
|
|
dir="../../dev/scripts",
|
|
cmd="chmod +x ./restart_backend_plugin.sh && ./restart_backend_plugin.sh",
|
|
resource_deps=["grafana", "build-oncall-plugin-backend"],
|
|
deps=['../../grafana-plugin/pkg/plugin']
|
|
) |