summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-07-30 18:41:55 +0200
committerxengineering <me@xengineering.eu>2024-07-30 18:41:55 +0200
commit35a716859e07e4b05032df327196b707e377f769 (patch)
tree87e324207ff8731d196f6e2c9ca1768d81b1d0e3
parent9a21437358bea8f347e98cba564a5b214bb6607b (diff)
downloadcraft-35a716859e07e4b05032df327196b707e377f769.tar
craft-35a716859e07e4b05032df327196b707e377f769.tar.zst
craft-35a716859e07e4b05032df327196b707e377f769.zip
Execute VM startup and source checkout in paralleloffline
This speeds the build process a bit up.
-rw-r--r--main.go17
1 files 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)