41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
|
// This is a simple example
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"go.wit.com/log"
|
||
|
)
|
||
|
|
||
|
func (r *repo) lookToUnwind() bool {
|
||
|
goSumS := r.getGoSumStatus()
|
||
|
dirtyS := r.dirtyLabel.String()
|
||
|
currentS := r.status.GetCurrentBranchVersion()
|
||
|
log.Info("repo:", r.String(), goSumS, dirtyS, r.lastTag.String(), currentS)
|
||
|
|
||
|
|
||
|
curName := r.status.GetCurrentBranchName()
|
||
|
mName := r.status.GetMasterBranchName()
|
||
|
|
||
|
if curName == mName {
|
||
|
log.Info("\trepo is ready working from main branch", curName, "=", mName)
|
||
|
} else {
|
||
|
log.Info("\trepo is not ready main branch", curName, "!=", mName)
|
||
|
r.setGoSumStatus("CAN NOT UNWIND")
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
if r.lastTag.String() != currentS {
|
||
|
log.Info("\trepo version mismatch last vs current", r.lastTag.String(), "!=", currentS)
|
||
|
r.setGoSumStatus("CAN NOT UNWIND")
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
if "v" + release.versionS != r.lastTag.String() {
|
||
|
log.Info("\trepo version mismatch last vs official", r.lastTag.String(), "!=", release.versionS)
|
||
|
r.setGoSumStatus("CAN NOT UNWIND")
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
r.setGoSumStatus("UNWIND")
|
||
|
return true
|
||
|
}
|