Skip to content

Commit

Permalink
feat: use environment variables PACT_BROKER_USERNAME and PACT_BROKER_…
Browse files Browse the repository at this point in the history
…PASSWORD when verifying a pact by URL, if the environment variables are present
  • Loading branch information
bethesque committed Feb 17, 2020
1 parent d494300 commit 308f25d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pact/cli/run_pact_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ def run_specs

def run_with_pact_url_string
pact_repository_uri_options = {}
pact_repository_uri_options[:username] = ENV['PACT_BROKER_USERNAME'] if ENV['PACT_BROKER_USERNAME']
pact_repository_uri_options[:password] = ENV['PACT_BROKER_PASSWORD'] if ENV['PACT_BROKER_PASSWORD']
pact_repository_uri_options[:token] = ENV['PACT_BROKER_TOKEN']
pact_repository_uri_options[:username] = options[:pact_broker_username] if options[:pact_broker_username]
pact_repository_uri_options[:password] = options[:pact_broker_password] if options[:pact_broker_password]
pact_repository_uri_options[:token] = ENV['PACT_BROKER_TOKEN']
pact_uri = ::Pact::Provider::PactURI.new(options[:pact_uri], pact_repository_uri_options)
Pact::Provider::PactSpecRunner.new([pact_uri], pact_spec_options).run
end
Expand Down

0 comments on commit 308f25d

Please sign in to comment.