diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-27 12:45:16 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-09-27 12:45:16 +0300 |
commit | 26e73c2e8fa3d6cdd85ba82628981d3334445aeb (patch) | |
tree | 67b1a286e243253961c84c1a6e9d113869820804 /app/services/ci | |
parent | 057a8b709346a89e2ccdfe6e9b352ce5f93e71c7 (diff) |
Add some minor improvements to pipeline creation chain
Diffstat (limited to 'app/services/ci')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index df5b32d97ca..31a712ccc1b 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -15,7 +15,7 @@ module Ci ref: ref, sha: sha, before_sha: before_sha, - tag: tag?, + tag: tag_exists?, trigger_requests: Array(trigger_request), user: current_user, pipeline_schedule: schedule, @@ -88,20 +88,14 @@ module Ci params[:ref] end - def tag? - return @is_tag if defined?(@is_tag) - - @is_tag = project.repository.tag_exists?(ref) + def tag_exists? + project.repository.tag_exists?(ref) end def ref @ref ||= Gitlab::Git.ref_name(origin_ref) end - def valid_sha? - origin_sha && origin_sha != Gitlab::Git::BLANK_SHA - end - def pipeline_created_counter @pipeline_created_counter ||= Gitlab::Metrics .counter(:pipelines_created_total, "Counter of pipelines created") |