Class: Gitlab::Ci::Pipeline::Chain::Create
- Inherits:
-
Base
- Object
- Base
- Gitlab::Ci::Pipeline::Chain::Create
show all
- Includes:
- Helpers, Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/pipeline/chain/create.rb
Instance Attribute Summary
Attributes inherited from Base
#command, #config, #pipeline
Instance Method Summary
collapse
Methods included from Helpers
#error, #warning
Methods inherited from Base
#initialize
Instance Method Details
#break? ⇒ Boolean
30
31
32
|
# File 'lib/gitlab/ci/pipeline/chain/create.rb', line 30
def break?
!pipeline.persisted?
end
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/gitlab/ci/pipeline/chain/create.rb', line 11
def perform!
logger.instrument_once_with_sql(:pipeline_save) do
::Gitlab::Ci::Pipeline::Create::JobDefinitionBuilder.new(pipeline, statuses).run
BulkInsertableAssociations.with_bulk_insert do
pipeline.save!
end
end
rescue ActiveRecord::RecordInvalid => e
error("Failed to persist the pipeline: #{e}")
rescue ActiveRecord::RecordNotUnique => e
raise unless e.message.include?('iid')
::InternalId.flush_records!(project: project, usage: :ci_pipelines)
error("Failed to persist the pipeline, please retry")
end
|