diff options
author | Azul <azul@riseup.net> | 2017-07-18 14:13:16 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2017-07-18 14:13:47 +0200 |
commit | 63799b2695e95ae686dab9fed6b8341e0a12dfe6 (patch) | |
tree | 9026a9622f02656a8651e86edcc6ce095e06a7fa /jobs | |
parent | 71207a9ebe82a7ac62c0ff32d8b34dbdf953f927 (diff) |
feat: only check builds where enabled and not archived
also reduced time between checks to 2 minutes and looking at last 50 builds.
Diffstat (limited to 'jobs')
-rw-r--r-- | jobs/gitlab_build_status.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/jobs/gitlab_build_status.rb b/jobs/gitlab_build_status.rb index f2f669a..fdfe8a8 100644 --- a/jobs/gitlab_build_status.rb +++ b/jobs/gitlab_build_status.rb @@ -1,21 +1,23 @@ require 'gitlab_stats' -SCHEDULER.every '300s', :first_in => 0 do +SCHEDULER.every '120s', :first_in => 0 do broken_builds = [] started = Time.now GitlabStats.projects.each do |proj| + next if proj[:archived] + next unless proj[:builds_enabled] GitlabStats.add_pipeline_stats_to proj + puts "#{proj[:name]} (#{proj[:ref]}): #{proj[:status]}" unless proj[:status] =~ /^success|running|No builds configured/ broken_builds << proj end - puts proj end failed = broken_builds.size > 0 send_event('gitlab-builds', { failed: failed, header: "Gitlab builds", broken_builds: broken_builds }) - puts "Going through all projects took: #{started - Time.now}." + puts "Going through all projects took: #{Time.now - started}." end |