debian-mirror-gitlab/lib/gitlab/ci/pipeline/chain/create.rb
2020-08-09 17:41:57 +05:30

25 lines
588 B
Ruby

# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
class Create < Chain::Base
include Chain::Helpers
def perform!
BulkInsertableAssociations.with_bulk_insert(enabled: ::Gitlab::Ci::Features.bulk_insert_on_create?(project)) do
pipeline.save!
end
rescue ActiveRecord::RecordInvalid => e
error("Failed to persist the pipeline: #{e}")
end
def break?
!pipeline.persisted?
end
end
end
end
end
end