OSDN Git Service

Show gitlab-ci status on project dashboard
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 14 May 2013 10:31:29 +0000 (13:31 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Tue, 14 May 2013 10:31:29 +0000 (13:31 +0300)
app/models/gitlab_ci_service.rb
app/views/projects/show.html.haml

index 4eb39c7..9b1c707 100644 (file)
@@ -46,4 +46,12 @@ class GitlabCiService < Service
   def build_page sha
     project_url + "/builds/#{sha}"
   end
+
+  def builds_path
+    project_url + "?ref=" + project.default_branch
+  end
+
+  def status_img_path
+    project_url + "/status.png?ref=" + project.default_branch
+  end
 end
index 6ee2e38..8a09513 100644 (file)
@@ -44,3 +44,8 @@
         %p
           Forked from:
           = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
+
+      - if @project.gitlab_ci?
+        %hr
+        = link_to @project.gitlab_ci_service.builds_path do
+          = image_tag @project.gitlab_ci_service.status_img_path, alt: "build status"