summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-07-18 14:13:16 +0200
committerAzul <azul@riseup.net>2017-07-18 14:13:47 +0200
commit63799b2695e95ae686dab9fed6b8341e0a12dfe6 (patch)
tree9026a9622f02656a8651e86edcc6ce095e06a7fa /lib
parent71207a9ebe82a7ac62c0ff32d8b34dbdf953f927 (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 'lib')
-rw-r--r--lib/gitlab_stats.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab_stats.rb b/lib/gitlab_stats.rb
index 5b41263..20b040a 100644
--- a/lib/gitlab_stats.rb
+++ b/lib/gitlab_stats.rb
@@ -13,13 +13,17 @@ module GitlabStats
# get a list of all projects
def self.projects
Gitlab.group(ENV['GITLAB_GROUP_ID']).projects.map do |proj|
- { :id => proj['id'], :name => proj['name'], :path => proj['path_with_namespace'],
+ { :id => proj['id'],
+ :name => proj['name'],
+ :path => proj['path_with_namespace'],
+ :archived => proj['archived'],
+ :builds_enabled => proj['builds_enabled'],
:default_branch => proj['default_branch']}
end
end
def self.add_pipeline_stats_to(proj)
- pipelines = Gitlab.pipelines(proj[:id], { per_page: 10 })
+ pipelines = Gitlab.pipelines(proj[:id], { per_page: 50 })
#pp pipeline[0]
pipeline = pipelines.find{|p| p.ref == proj[:default_branch]}
if pipeline.nil?