mirror of https://github.com/kubernetes/kops.git
Use PULL_PULL_SHA as gcs location sha if available
This commit is contained in:
parent
e34335fd43
commit
d5372e7387
|
|
@ -92,14 +92,17 @@ func defaultStageLocation(kopsRoot string) (string, error) {
|
||||||
jobName = defaultJobName
|
jobName = defaultJobName
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command("git", "rev-parse", "--short", "HEAD")
|
sha := os.Getenv("PULL_PULL_SHA")
|
||||||
cmd.SetDir(kopsRoot)
|
if sha == "" {
|
||||||
output, err := exec.CombinedOutputLines(cmd)
|
cmd := exec.Command("git", "rev-parse", "--short", "HEAD")
|
||||||
if err != nil {
|
cmd.SetDir(kopsRoot)
|
||||||
return "", err
|
output, err := exec.CombinedOutputLines(cmd)
|
||||||
} else if len(output) != 1 {
|
if err != nil {
|
||||||
return "", fmt.Errorf("unexpected output from git describe: %v", output)
|
return "", err
|
||||||
|
} else if len(output) != 1 {
|
||||||
|
return "", fmt.Errorf("unexpected output from git describe: %v", output)
|
||||||
|
}
|
||||||
|
sha = strings.TrimSpace(output[0])
|
||||||
}
|
}
|
||||||
sha := strings.TrimSpace(output[0])
|
|
||||||
return fmt.Sprintf(defaultGCSPath, jobName, sha), nil
|
return fmt.Sprintf(defaultGCSPath, jobName, sha), nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue