stupid. really stupid. of course that code doesn't run in main()
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
2ba4c6e6ee
commit
4c9be65aba
7
Makefile
7
Makefile
|
@ -49,16 +49,9 @@ push:
|
||||||
|
|
||||||
tag-version:
|
tag-version:
|
||||||
# git push --delete origin v0.6.15 # to delete a tag upstream
|
# git push --delete origin v0.6.15 # to delete a tag upstream
|
||||||
-rm cloud-control-panel
|
|
||||||
go build
|
|
||||||
git tag v${VERSION}
|
git tag v${VERSION}
|
||||||
git push --tags
|
git push --tags
|
||||||
cp .git/refs/tags/v${VERSION} resources/tags/
|
cp .git/refs/tags/v${VERSION} resources/tags/
|
||||||
// scp resources/VERSION root@mirrors.wit.com:/data/mirrors/cloud/control-panel/linux/
|
|
||||||
// scp resources/BUILDDATE root@mirrors.wit.com:/data/mirrors/cloud/control-panel/linux/
|
|
||||||
// scp cloud-control-panel root@mirrors.wit.com:/data/mirrors/cloud/control-panel/linux/
|
|
||||||
// scp cloud-control-panel root@mirrors.wit.com:/data/mirrors/cloud/control-panel/linux/cloud-control-panel-v${VERSION}
|
|
||||||
// scp README root@mirrors.wit.com:/data/mirrors/cloud/control-panel/
|
|
||||||
|
|
||||||
# should update every go dependancy (?)
|
# should update every go dependancy (?)
|
||||||
update:
|
update:
|
||||||
|
|
|
@ -5,6 +5,7 @@ package main
|
||||||
// upload binary to mirrors.wit.com/cloud/control-panel
|
// upload binary to mirrors.wit.com/cloud/control-panel
|
||||||
|
|
||||||
import "log"
|
import "log"
|
||||||
|
import "fmt"
|
||||||
import "time"
|
import "time"
|
||||||
import "strings"
|
import "strings"
|
||||||
import "os/user"
|
import "os/user"
|
||||||
|
@ -15,7 +16,6 @@ import "github.com/davecgh/go-spew/spew"
|
||||||
|
|
||||||
import "git.wit.com/wit/shell"
|
import "git.wit.com/wit/shell"
|
||||||
|
|
||||||
// import "fmt"
|
|
||||||
// import "os/user"
|
// import "os/user"
|
||||||
// import "io/ioutil"
|
// import "io/ioutil"
|
||||||
// github.com/bramvdbogaerde/go-scp
|
// github.com/bramvdbogaerde/go-scp
|
||||||
|
@ -91,9 +91,16 @@ func build(tag string) *bool {
|
||||||
// os.Exit(-1)
|
// os.Exit(-1)
|
||||||
// return nil
|
// return nil
|
||||||
}
|
}
|
||||||
shell.Run("rm cloud-control-panel")
|
|
||||||
|
// 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("go build")
|
shell.Run("go build")
|
||||||
md5sum = shell.Run("md5sum cloud-control-panel")
|
md5sum = shell.Run("md5sum " + filename)
|
||||||
log.Println("\tmd5sum =", md5sum)
|
log.Println("\tmd5sum =", md5sum)
|
||||||
|
|
||||||
if (md5sum == "") {
|
if (md5sum == "") {
|
||||||
|
|
10
main.go
10
main.go
|
@ -95,11 +95,13 @@ func lookupAAAA(hostname string) string {
|
||||||
func main() {
|
func main() {
|
||||||
go handleErrors()
|
go handleErrors()
|
||||||
|
|
||||||
epoch := fmt.Sprintf("%d", time.Now().Unix())
|
// OMG I'm an idiot. of course this does't work
|
||||||
shell.Write("./resources/BUILDDATE", epoch)
|
// it's easy to loose your mind trying to make this part of the code work
|
||||||
|
// epoch := fmt.Sprintf("%d", time.Now().Unix())
|
||||||
|
// shell.Write("./resources/BUILDDATE", epoch)
|
||||||
|
|
||||||
ref := shell.Run("git rev-list -1 HEAD")
|
// ref := shell.Run("git rev-list -1 HEAD")
|
||||||
shell.Write("./resources/BUILDREF", ref)
|
// shell.Write("./resources/BUILDREF", ref)
|
||||||
// for {}
|
// for {}
|
||||||
|
|
||||||
// This puts all the files in that directory in the binary
|
// This puts all the files in that directory in the binary
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
2ba4c6e6ee8042e87d97d724caea8df1ac69d26b
|
Loading…
Reference in New Issue