diff --git a/.gitignore b/.gitignore index b4369fc..1a61243 100644 --- a/.gitignore +++ b/.gitignore @@ -11,18 +11,5 @@ resources/BUILDDATE cloud-control-panel -example-gui/example-gui -example-systray/example-systray -example-UI-table/example-UI-table -example-table/example-table -example-aminal/example-aminal -example-multiple-windows/example-multiple-windows -example-lookupAAAA/example-lookupAAAA - +build/build autobuild/autobuild - -test1/test1 -test2/test2 -test3/test3 -test4/test4 -test5/test5 diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..5f03483 --- /dev/null +++ b/build/Makefile @@ -0,0 +1,2 @@ +all: + go build diff --git a/build/build.go b/build/build.go new file mode 100644 index 0000000..12b14f5 --- /dev/null +++ b/build/build.go @@ -0,0 +1,49 @@ +package main + +// This should build and upload the binary to mirrors + +// upload binary to mirrors.wit.com/cloud/control-panel + +import "log" +import "fmt" +import "time" + +// import "github.com/davecgh/go-spew/spew" + +import "git.wit.com/wit/shell" + +// import "os/user" +// import "io/ioutil" +// github.com/bramvdbogaerde/go-scp + +var filename string +var builddir string + +func main() { + filename := "cloud-control-panel" + // shell.Quiet(true) + shell.Quiet(false) + + gitref := shell.Run("git rev-list -1 HEAD") + + // setup the files that will end up in the binary + epoch := fmt.Sprintf("%d", time.Now().Unix()) + shell.Write("./resources/BUILDDATE", epoch) + shell.Write("./resources/BUILDREF", gitref) + + // rebuild the binary (always remove the old one + shell.Run("rm " + filename) + shell.Run("packr build") + log.Println("build finished") + /* + md5sum = shell.Run("md5sum " + filename) + log.Println("\tmd5sum =", md5sum) + + if (md5sum == "") { + log.Println("\tBUILD FAILED") + b = false + return &b + } + shell.Write("/tmp/autobuild.md5sum", md5sum) + */ +}