diff options
-rw-r--r-- | main.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -3,6 +3,7 @@ package main import ( "bytes" "flag" + "fmt" "log" "os" "os/exec" @@ -13,11 +14,13 @@ import ( var ( repo = "" commit = "" + task = "" ) func init() { flag.StringVar(&repo, "repo", "", "Source code as valid Git URL") flag.StringVar(&commit, "commit", "", "Commit or commit-ish reference for checkout") + flag.StringVar(&task, "task", "", "Shell code to execute for the build") } func main() { @@ -46,11 +49,10 @@ func runCommand(dir string, name string, args ...string) { } func craft(workbench string) { - script := `#!/bin/sh + script := fmt.Sprintf(`#!/bin/sh -source craft.sh -build -` +%s +`, task) cmd := exec.Command("busybox", "ash") cmd.Dir = workbench |