builds automatically
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
e4e12ae90d
commit
0322b3ad85
2
Makefile
2
Makefile
|
@ -1,7 +1,7 @@
|
|||
.PHONY: debian
|
||||
|
||||
run: build
|
||||
./go-deb --open-gui
|
||||
./go-deb --no-gui --repo go.wit.com/apps/control-panel-dns
|
||||
|
||||
dns: build
|
||||
./go-deb --repo go.wit.com/apps/control-panel-dns
|
||||
|
|
|
@ -52,7 +52,6 @@ func (c *controlBox) addRepo(path string) {
|
|||
c.status.SetUserWorkingName("jcarr")
|
||||
c.status.Update()
|
||||
|
||||
|
||||
cbname := c.status.GetCurrentBranchName()
|
||||
cbversion := c.status.GetCurrentBranchVersion()
|
||||
debversion := strings.TrimPrefix(cbversion, "v")
|
||||
|
|
3
args.go
3
args.go
|
@ -14,8 +14,9 @@ import (
|
|||
|
||||
var args struct {
|
||||
TmpLog bool `arg:"--tmp-log" help:"automatically send STDOUT to /tmp"`
|
||||
OpenGui bool `arg:"--open-gui" help:"open the go-deb gui"`
|
||||
NoGui bool `arg:"--no-gui" help:"don't open the gui, just make the .deb"`
|
||||
Repo string `arg:"--repo" help:"go get path to the repo"`
|
||||
PkgDir string `arg:"--pkg-dir" help:"set default directory (~/incoming/)"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
25
main.go
25
main.go
|
@ -20,6 +20,12 @@ var cBox *controlBox
|
|||
var basicWindow *gadgets.BasicWindow
|
||||
|
||||
func main() {
|
||||
if args.Repo == "" {
|
||||
log.Info("You need to tell me what repo you want to work on")
|
||||
println("")
|
||||
println("go-deb --repo go.wit.com/apps/helloworld")
|
||||
os.Exit(0)
|
||||
}
|
||||
if debugger.ArgDebug() {
|
||||
log.SetAll(true)
|
||||
log.ShowFlags()
|
||||
|
@ -33,20 +39,18 @@ func main() {
|
|||
|
||||
basicWindow = makebasicWindow()
|
||||
|
||||
if args.Repo != "" {
|
||||
filepath := filepath.Join("/home/jcarr/go/src", args.Repo)
|
||||
os.Chdir(filepath)
|
||||
|
||||
cBox.addRepo(args.Repo)
|
||||
cBox.readControlFile()
|
||||
basicWindow.Show()
|
||||
// go will sit here until the window exits
|
||||
gui.Watchdog()
|
||||
if args.NoGui {
|
||||
if cBox.buildPackage() {
|
||||
log.Info("build worked")
|
||||
} else {
|
||||
log.Warn("build failed")
|
||||
}
|
||||
if args.OpenGui {
|
||||
basicWindow.Show()
|
||||
// go will sit here until the window exits
|
||||
gui.Watchdog()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// run the debugger if triggered from the commandline
|
||||
|
@ -56,4 +60,9 @@ func main() {
|
|||
debugger.DebugWindow()
|
||||
}()
|
||||
}
|
||||
|
||||
basicWindow.Show()
|
||||
// go will sit here until the window exits
|
||||
gui.Watchdog()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"go.wit.com/lib/gadgets"
|
||||
|
@ -125,15 +126,22 @@ func (c *controlBox) buildPackage() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
shell.Run([]string{"dpkg-deb", "--build", "files", debname})
|
||||
if shell.Exists(debname) {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
log.Warn("os.UserHomeDir() failed")
|
||||
return false
|
||||
}
|
||||
|
||||
fulldebname := filepath.Join(homeDir, "incoming", debname)
|
||||
shell.Run([]string{"dpkg-deb", "--build", "files", fulldebname})
|
||||
if shell.Exists(fulldebname) {
|
||||
log.Warn("build worked")
|
||||
} else {
|
||||
log.Warn("build failed")
|
||||
return false
|
||||
}
|
||||
shell.Run([]string{"dpkg-deb", "-I", debname})
|
||||
shell.Run([]string{"dpkg-deb", "-c", debname})
|
||||
shell.Run([]string{"dpkg-deb", "-I", fulldebname})
|
||||
shell.Run([]string{"dpkg-deb", "-c", fulldebname})
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue