Class: Gitlab::Ci::Pipeline::Chain::Create

Inherits:
Base
  • Object
show all
Includes:
Helpers
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, #persist_pipeline?, #warning

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::Pipeline::Chain::Base

Instance Method Details

#break?Boolean

Returns:

  • (Boolean)

18
19
20
# File 'lib/gitlab/ci/pipeline/chain/create.rb', line 18

def break?
  !pipeline.persisted?
end

#perform!Object


10
11
12
13
14
15
16
# File 'lib/gitlab/ci/pipeline/chain/create.rb', line 10

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