Skip to content

Commit

Permalink
exit with status 1 when all checks are not healthy (useful for CI)
Browse files Browse the repository at this point in the history
  • Loading branch information
beyang committed Sep 7, 2016
1 parent c0aaf16 commit 0e35792
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ a single checkup and print results to stdout. To
store the results of the check, use --store.`,

Run: func(cmd *cobra.Command, args []string) {
allHealthy := true
c := loadCheckup()

if storeResults {
Expand All @@ -54,6 +55,13 @@ store the results of the check, use --store.`,

for _, result := range results {
fmt.Println(result)
if !result.Healthy {
allHealthy = false
}
}

if !allHealthy {
os.Exit(1)
}
},
}
Expand Down

0 comments on commit 0e35792

Please sign in to comment.