updates with golang systems correctly
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
9c6890134a
commit
ad2c989f77
|
@ -49,7 +49,7 @@ func CheckReady() bool {
|
|||
}
|
||||
return true
|
||||
}
|
||||
if goSumS == "UNCHANGED" {
|
||||
if goSumS == "UNRELEASED" {
|
||||
return true
|
||||
}
|
||||
if goSumS == "READY" {
|
||||
|
@ -58,7 +58,7 @@ func CheckReady() bool {
|
|||
return true
|
||||
}
|
||||
if lastS == currentS {
|
||||
release.current.setGoSumStatus("UNCHANGED")
|
||||
release.current.setGoSumStatus("UNRELEASED")
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -41,6 +41,10 @@ type releaseStruct struct {
|
|||
sendVersionB *gui.Node
|
||||
checkSafeB *gui.Node
|
||||
whitelist map[string]*repo
|
||||
|
||||
// store myself here. use myself to
|
||||
// do garbage go get tests and other potential junk
|
||||
guireleaser *repo
|
||||
}
|
||||
|
||||
func (w *autoType) Disable() {
|
||||
|
@ -105,6 +109,10 @@ func createReleaseBox(box *gui.Node) {
|
|||
log.Warn("attempting to release. TODO: recheck go.sum here", release.version.String())
|
||||
log.Warn("Sleep 10")
|
||||
log.Sleep(10)
|
||||
case "UNRELEASED":
|
||||
log.Warn("attempting to release. TODO: dig deep on go.sum here", release.version.String())
|
||||
log.Warn("Sleep 10")
|
||||
log.Sleep(10)
|
||||
default:
|
||||
log.Warn("what is this?", release.version.String(), release.status.String())
|
||||
return
|
||||
|
@ -140,14 +148,24 @@ func createReleaseBox(box *gui.Node) {
|
|||
log.Info("EVERYTHING OK")
|
||||
release.current.setGoSumStatus("RELEASED")
|
||||
|
||||
os.Unsetenv("GO111MODULE")
|
||||
gopath := release.current.String()
|
||||
cmd := []string{"go", "get", "-v", gopath + "@" + release.version.String()}
|
||||
log.Info("SHOULD RUN cmd HERE to update myself:", cmd)
|
||||
log.Info("SHOULD RUN cmd HERE:", cmd)
|
||||
log.Info("SHOULD RUN cmd HERE:", cmd)
|
||||
|
||||
// release.current.status.RunCmd(
|
||||
if release.guireleaser != nil {
|
||||
os.Unsetenv("GO111MODULE")
|
||||
log.Info("TRYING TO SELF UPDATE HERE. cmd =", cmd)
|
||||
err, out := release.guireleaser.status.RunCmd(cmd)
|
||||
if err == nil {
|
||||
log.Info("SELF UPDATE WORKED\n", out)
|
||||
} else {
|
||||
log.Info("SELF UPDATE FAILED err =", err)
|
||||
log.Info("SELF UPDATE FAILED out =", out)
|
||||
return
|
||||
}
|
||||
}
|
||||
buttonEnable()
|
||||
} else {
|
||||
log.Info("SOMETHING FAILED")
|
||||
|
@ -428,6 +446,12 @@ func findNextDirty() bool {
|
|||
if goSumS == "IGNORE" {
|
||||
continue
|
||||
}
|
||||
if goSumS == "UNRELEASED" {
|
||||
if setCurrentRepo(repo, "UNRELEASED", "manually check go.sum") {
|
||||
return true
|
||||
}
|
||||
continue
|
||||
}
|
||||
if goSumS == "NOT READY" {
|
||||
if setCurrentRepo(repo, "NOT READY", "manually check go.sum") {
|
||||
return true
|
||||
|
|
5
scan.go
5
scan.go
|
@ -74,6 +74,11 @@ func (r *repo) checkSafeGoSumRemake() {
|
|||
|
||||
func scanGoSum() {
|
||||
for _, repo := range me.allrepos {
|
||||
if repo.String() == "go.wit.com/apps/guireleaser" {
|
||||
if release.guireleaser == nil {
|
||||
release.guireleaser = repo
|
||||
}
|
||||
}
|
||||
latestversion := repo.status.GetLastTagVersion()
|
||||
if repo.getGoSumStatus() == "BAD" {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue