Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
- Fixed a bug where running builds would go into influxdb and show up as failures
  • Loading branch information
Joonas Lehtimäki committed Mar 6, 2020
1 parent 3090c61 commit c4d673a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pkg/repository/repository.go
Expand Up @@ -122,16 +122,19 @@ func getBuildInfo(build Build, repoNamespace string, repoName string) error{
}

// Loop through build info stages and save the results into DB
// Don't save running pipelines and set BuildState integer according to the status because of Grafana
for _, y := range buildInfo.Stages {
if y.Status == "success" {
build.BuildState = 1
build.Status = "success"
} else {
build.BuildState = 0
build.Status = "failure"
if y.Status != "running" {
if y.Status == "success" {
build.BuildState = 1
build.Status = "success"
} else {
build.BuildState = 0
build.Status = "failure"
}
build.Pipeline = y.Name
influxdb.Run(structs.Map(build), y.Name)
}
build.Pipeline = y.Name
influxdb.Run(structs.Map(build), y.Name)
}

return nil
Expand Down

0 comments on commit c4d673a

Please sign in to comment.