Fetch benchmark before checkout
This commit is contained in:
@@ -47,8 +47,11 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Done; Checking out benchmark branch")
|
log.Printf("Benchmarking done; Fetching benchmark branch")
|
||||||
|
fetchBenchmark()
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
log.Printf("Checking out benchmark branch")
|
||||||
checkoutBenchmark()
|
checkoutBenchmark()
|
||||||
time.Sleep(200 * time.Millisecond)
|
time.Sleep(200 * time.Millisecond)
|
||||||
log.Printf("Adding benchmark results")
|
log.Printf("Adding benchmark results")
|
||||||
@@ -72,8 +75,17 @@ func getHeadHash() string {
|
|||||||
return strings.TrimSpace(string(out))
|
return strings.TrimSpace(string(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func fetchBenchmark() {
|
||||||
|
gitFetch := exec.Command("git", "fetch", "origin", "benchmark")
|
||||||
|
gitFetch.Dir = "../"
|
||||||
|
out, err := gitFetch.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Could not fetch benchmark branch with code %v and error %v", err, string(out))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func checkoutBenchmark() {
|
func checkoutBenchmark() {
|
||||||
gitCheckout := exec.Command("git", "checkout", "benchmark")
|
gitCheckout := exec.Command("git", "checkout", "origin/benchmark")
|
||||||
gitCheckout.Dir = "../"
|
gitCheckout.Dir = "../"
|
||||||
out, err := gitCheckout.CombinedOutput()
|
out, err := gitCheckout.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user