summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/main.go b/main.go
index 301fca2..913b5b5 100644
--- a/main.go
+++ b/main.go
@@ -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