updates with golang systems correctly

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-01 15:16:15 -06:00
parent 9c6890134a
commit ad2c989f77
3 changed files with 33 additions and 4 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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