Class: PactBroker::Client::Versions::RecordDeployment

Inherits:
Object
  • Object
show all
Includes:
HalClientMethods
Defined in:
lib/pact_broker/client/versions/record_deployment.rb

Constant Summary collapse

NOT_SUPPORTED_MESSAGE =
"This version of the Pact Broker does not support recording deployments. Please upgrade to version 2.80.0 or later."

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HalClientMethods

#create_http_client, #create_index_entry_point, #index_entry_point, #index_resource

Constructor Details

#initialize(params, pact_broker_base_url, pact_broker_client_options) ⇒ RecordDeployment

Returns a new instance of RecordDeployment.



17
18
19
20
21
22
23
24
25
# File 'lib/pact_broker/client/versions/record_deployment.rb', line 17

def initialize(params, pact_broker_base_url, pact_broker_client_options)
  @pact_broker_base_url = pact_broker_base_url
  @pacticipant_name = params.fetch(:pacticipant_name)
  @version_number = params.fetch(:version_number)
  @environment_name = params.fetch(:environment_name)
  @replaced_previous_deployed_version = params.fetch(:replaced_previous_deployed_version)
  @output = params.fetch(:output)
  @pact_broker_client_options = pact_broker_client_options
end

Class Method Details

.call(params, pact_broker_base_url, pact_broker_client_options) ⇒ Object



13
14
15
# File 'lib/pact_broker/client/versions/record_deployment.rb', line 13

def self.call(params, pact_broker_base_url, pact_broker_client_options)
  new(params, pact_broker_base_url, pact_broker_client_options).call
end

Instance Method Details

#callObject



27
28
29
30
31
32
33
34
# File 'lib/pact_broker/client/versions/record_deployment.rb', line 27

def call
  check_if_command_supported
  record_deployment

  PactBroker::Client::CommandResult.new(true, result_message)
rescue PactBroker::Client::Error => e
  PactBroker::Client::CommandResult.new(false, e.message)
end