This commit is contained in:
30
main.go
30
main.go
@@ -1,7 +1,35 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Printf("hello, world!\n")
|
||||
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Println("must pass in a git repo to build")
|
||||
os.Exit(1)
|
||||
}
|
||||
repo := os.Args[1]
|
||||
if err := build(repo); err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
func build(repoUrl string) error {
|
||||
fmt.Printf("Building %s\n", repoUrl)
|
||||
|
||||
// 1. Get a context
|
||||
ctx := context.Background()
|
||||
// 2. Initialize dagger client
|
||||
client, err := dagger.Connect(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user