9598e8783b
* 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)
* Comment out kindsysreport/codegen/report.go on Makefile
* Disable steps that don't work for older versions
* Fix permissions of validate-npm-packages.sh
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)
|
|
}
|