Fixed issue with logging and getting latest version
This commit is contained in:
parent
65c489c920
commit
acfa4ff7fe
8
cycle.go
8
cycle.go
@ -220,7 +220,7 @@ func (p *Project) fetch() {
|
||||
}
|
||||
|
||||
//log fetch results
|
||||
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(fetchResult))) {
|
||||
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(fetchResult))) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ func (p *Project) build() {
|
||||
return
|
||||
}
|
||||
|
||||
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(output))) {
|
||||
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(output))) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ func (p *Project) test() {
|
||||
return
|
||||
}
|
||||
|
||||
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(output))) {
|
||||
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(output))) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ func (p *Project) release() {
|
||||
return
|
||||
}
|
||||
|
||||
if p.errHandled(p.ds.AddLog(p.stage, p.version, string(output))) {
|
||||
if p.errHandled(p.ds.AddLog(p.version, p.stage, string(output))) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ func (ds *Store) LatestVersion() (string, error) {
|
||||
err := ds.bolt.View(func(tx *bolt.Tx) error {
|
||||
c := tx.Bucket([]byte(bucketLog)).Cursor()
|
||||
|
||||
for k, v := c.Last(); k != nil; k, v = c.Prev() {
|
||||
for k, v := c.First(); k != nil; k, v = c.Next() {
|
||||
l := &log{}
|
||||
err := json.Unmarshal(v, l)
|
||||
if err != nil {
|
||||
@ -60,5 +60,6 @@ func (ds *Store) LatestVersion() (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return version, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user