* CI: Update CI/CD tooling and pipelines from main (#76814)
* CI: Update CI/CD tooling and pipelines from main
* Update Makefile
* Comment out validate_openapi_spec_step
* Update broken frontend tests
* Fix validate-npm-packages regex to work without suffix
* Fix cypress image version
(cherry picked from commit 03ecb1db39)
* Fix path for ./pkg/kindsys/report.go on Makefile
* Re-add ./pkg/cmd/grafana-cli/runner to make gen-go
31 lines
667 B
Go
31 lines
667 B
Go
package build
|
|
|
|
func getGitBranch() string {
|
|
v, err := runError("git", "rev-parse", "--abbrev-ref", "HEAD")
|
|
if err != nil {
|
|
return "main"
|
|
}
|
|
return string(v)
|
|
}
|
|
|
|
func getGitSha() string {
|
|
v, err := runError("git", "rev-parse", "--short", "HEAD")
|
|
if err != nil {
|
|
return "unknown-dev"
|
|
}
|
|
return string(v)
|
|
}
|
|
|
|
func getGitEnterpriseSha() string {
|
|
// supporting the old way of dev setup
|
|
v, err := runError("git", "-C", "../grafana-enterprise", "rev-parse", "--short", "HEAD")
|
|
if err != nil {
|
|
// supporting the new way of dev setup
|
|
v, err = runError("git", "-C", "..", "rev-parse", "--short", "HEAD")
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
}
|
|
return string(v)
|
|
}
|