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
|
return true
|
||||||
}
|
}
|
||||||
if goSumS == "UNCHANGED" {
|
if goSumS == "UNRELEASED" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if goSumS == "READY" {
|
if goSumS == "READY" {
|
||||||
|
@ -58,7 +58,7 @@ func CheckReady() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if lastS == currentS {
|
if lastS == currentS {
|
||||||
release.current.setGoSumStatus("UNCHANGED")
|
release.current.setGoSumStatus("UNRELEASED")
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,10 @@ type releaseStruct struct {
|
||||||
sendVersionB *gui.Node
|
sendVersionB *gui.Node
|
||||||
checkSafeB *gui.Node
|
checkSafeB *gui.Node
|
||||||
whitelist map[string]*repo
|
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() {
|
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("attempting to release. TODO: recheck go.sum here", release.version.String())
|
||||||
log.Warn("Sleep 10")
|
log.Warn("Sleep 10")
|
||||||
log.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:
|
default:
|
||||||
log.Warn("what is this?", release.version.String(), release.status.String())
|
log.Warn("what is this?", release.version.String(), release.status.String())
|
||||||
return
|
return
|
||||||
|
@ -140,14 +148,24 @@ func createReleaseBox(box *gui.Node) {
|
||||||
log.Info("EVERYTHING OK")
|
log.Info("EVERYTHING OK")
|
||||||
release.current.setGoSumStatus("RELEASED")
|
release.current.setGoSumStatus("RELEASED")
|
||||||
|
|
||||||
os.Unsetenv("GO111MODULE")
|
|
||||||
gopath := release.current.String()
|
gopath := release.current.String()
|
||||||
cmd := []string{"go", "get", "-v", gopath + "@" + release.version.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 to update myself:", cmd)
|
||||||
log.Info("SHOULD RUN cmd HERE:", cmd)
|
log.Info("SHOULD RUN cmd HERE:", 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()
|
buttonEnable()
|
||||||
} else {
|
} else {
|
||||||
log.Info("SOMETHING FAILED")
|
log.Info("SOMETHING FAILED")
|
||||||
|
@ -428,6 +446,12 @@ func findNextDirty() bool {
|
||||||
if goSumS == "IGNORE" {
|
if goSumS == "IGNORE" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if goSumS == "UNRELEASED" {
|
||||||
|
if setCurrentRepo(repo, "UNRELEASED", "manually check go.sum") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
if goSumS == "NOT READY" {
|
if goSumS == "NOT READY" {
|
||||||
if setCurrentRepo(repo, "NOT READY", "manually check go.sum") {
|
if setCurrentRepo(repo, "NOT READY", "manually check go.sum") {
|
||||||
return true
|
return true
|
||||||
|
|
5
scan.go
5
scan.go
|
@ -74,6 +74,11 @@ func (r *repo) checkSafeGoSumRemake() {
|
||||||
|
|
||||||
func scanGoSum() {
|
func scanGoSum() {
|
||||||
for _, repo := range me.allrepos {
|
for _, repo := range me.allrepos {
|
||||||
|
if repo.String() == "go.wit.com/apps/guireleaser" {
|
||||||
|
if release.guireleaser == nil {
|
||||||
|
release.guireleaser = repo
|
||||||
|
}
|
||||||
|
}
|
||||||
latestversion := repo.status.GetLastTagVersion()
|
latestversion := repo.status.GetLastTagVersion()
|
||||||
if repo.getGoSumStatus() == "BAD" {
|
if repo.getGoSumStatus() == "BAD" {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue