summaryrefslogtreecommitdiff
path: root/app/services/ci/create_pipeline_service.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-08-11 20:54:02 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-08-11 21:32:16 +0200
commit6a6a69f4afbe0107a75df018b662f02b5ec0166a (patch)
treeb7a49ab9b0913d90251245648a885de9442708c9 /app/services/ci/create_pipeline_service.rb
parentd983c5bd4671d989edf3741d0db0a54dcef9c3b6 (diff)
downloadgitlab-ce-6a6a69f4afbe0107a75df018b662f02b5ec0166a.tar.gz
Use state machine for pipeline event processing
Diffstat (limited to 'app/services/ci/create_pipeline_service.rb')
-rw-r--r--app/services/ci/create_pipeline_service.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 7398fd8e10a..cde856b0186 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -37,7 +37,8 @@ module Ci
end
if !ignore_skip_ci && skip_ci?
- return error('Creation of pipeline is skipped', save: save_on_errors)
+ pipeline.skip if save_on_errors
+ return pipeline
end
unless pipeline.config_builds_attributes.present?
@@ -93,7 +94,7 @@ module Ci
def error(message, save: false)
pipeline.errors.add(:base, message)
- pipeline.reload_status! if save
+ pipeline.drop if save
pipeline
end
end