summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-03-02 16:22:50 +0000
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-03-02 16:22:50 +0000
commitba9bb4f59f0a8095350c433a303dc46c24bc34b1 (patch)
treef0206afc57f7a835d0bb75fdc54a8b8129735bbb /app/services
parent1fbc4886684b904f2de9e5f726f9e8c0baa76352 (diff)
parentb8ca9bc43a9504dad94a66630170ab6311eb5c09 (diff)
downloadgitlab-ce-ba9bb4f59f0a8095350c433a303dc46c24bc34b1.tar.gz
Merge branch 'master' into 'zj-create-mattermost-team'
# Conflicts: # app/assets/javascripts/dispatcher.js.es6
Diffstat (limited to 'app/services')
-rw-r--r--app/services/ci/image_for_build_service.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/app/services/ci/image_for_build_service.rb b/app/services/ci/image_for_build_service.rb
deleted file mode 100644
index 240ddabec36..00000000000
--- a/app/services/ci/image_for_build_service.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-module Ci
- class ImageForBuildService
- def execute(project, opts)
- ref = opts[:ref]
- sha = opts[:sha] || ref_sha(project, ref)
- pipelines = project.pipelines.where(sha: sha)
-
- image_name = image_for_status(pipelines.latest_status(ref))
- image_path = Rails.root.join('public/ci', image_name)
-
- OpenStruct.new(path: image_path, name: image_name)
- end
-
- private
-
- def ref_sha(project, ref)
- project.commit(ref).try(:sha) if ref
- end
-
- def image_for_status(status)
- status ||= 'unknown'
- 'build-' + status + ".svg"
- end
- end
-end