From 35a716859e07e4b05032df327196b707e377f769 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 30 Jul 2024 18:41:55 +0200 Subject: Execute VM startup and source checkout in parallel This speeds the build process a bit up. --- main.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index 8247ab4..fc97413 100644 --- a/main.go +++ b/main.go @@ -42,15 +42,8 @@ func main() { log.Println("Starting craft") defer log.Println("Exiting craft") - source, err := os.MkdirTemp("", "*-craft") - if err != nil { - log.Fatal(err) - } - defer os.RemoveAll(source) - checkout(repo, commit, source) - vm := qemu() - err = vm.Start() + err := vm.Start() if err != nil { log.Fatal(err) } @@ -60,6 +53,14 @@ func main() { log.Fatal(err) } }() + + source, err := os.MkdirTemp("", "*-craft") + if err != nil { + log.Fatal(err) + } + defer os.RemoveAll(source) + checkout(repo, commit, source) + waitBoot() upload(source) -- cgit v1.2.3-70-g09d2