The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/build/lerna/lerna.go

36 lines
823 B

package lerna
import (
"context"
"fmt"
"os"
"os/exec"
"github.com/grafana/grafana/pkg/build/fsutil"
)
func PackFrontendPackages(ctx context.Context, tag, grafanaDir, artifactsDir string) error {
exists, err := fsutil.Exists(artifactsDir)
if err != nil {
return err
}
if exists {
err = os.RemoveAll(artifactsDir)
if err != nil {
return err
}
}
// nolint:gosec
if err = os.MkdirAll(artifactsDir, 0755); err != nil {
return err
}
// nolint:gosec
cmd := exec.CommandContext(ctx, "yarn", "lerna", "exec", "--no-private", "--", "yarn", "pack", "--out", fmt.Sprintf("../../npm-artifacts/%%s-%v.tgz", tag))
cmd.Dir = grafanaDir
if output, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("command '%s' failed to run, output: %s, err: %q", cmd.String(), output, err)
}
return nil
}