Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ADD docker/pact /usr/local/bin/pact

RUN apk update \
&& apk add ruby=3.4.4-r0 \
ca-certificates=20250619-r0 \
ca-certificates=20250911-r0 \
libressl \
less \
git \
Expand All @@ -29,7 +29,7 @@ RUN apk update \
&& bundle config git.allow_insecure true \
&& gem update --system 3.6.9 \
&& gem install json -v "~>2.15" \
&& gem install bigdecimal -v "~>3.2" \
&& gem install bigdecimal -v "~>3.3" \
&& gem install racc -v "~>1.8" \
&& gem uninstall rubygems-update \
&& gem cleanup \
Expand Down Expand Up @@ -75,7 +75,9 @@ RUN case ${TARGETPLATFORM} in \
&& wget -qO - https://github.com/pact-foundation/pact-reference/releases/download/pact_verifier_cli-v1.1.3/pact_verifier_cli-linux-${BIN_ARCH}.gz \
| gunzip -fc > ./bin/pact_verifier_cli && chmod +x ./bin/pact_verifier_cli \
&& wget -qO - https://github.com/pact-foundation/pact-core-mock-server/releases/download/pact_mock_server_cli-v1.0.6/pact_mock_server_cli-linux-${BIN_ARCH}.gz \
| gunzip -fc > ./bin/pact_mock_server_cli && chmod +x ./bin/pact_mock_server_cli
| gunzip -fc > ./bin/pact_mock_server_cli && chmod +x ./bin/pact_mock_server_cli \
&& wget -qO - https://github.com/pact-foundation/pact-broker-cli/releases/download/v0.1.0/pact-broker-cli-${BIN_ARCH}-linux-musl \
-O ./bin/pact-broker-cli && chmod +x ./bin/pact-broker-cli


ENTRYPOINT ["/pact/entrypoint.sh"]
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ PATH
remote: .
specs:
pact-cli (1.5.0)
bigdecimal (~> 3.2)
json (~> 2.13)
bigdecimal (~> 3.3)
json (~> 2.15)
pact-mock_service
pact-provider-verifier
pact_broker-client (~> 1.28)
Expand All @@ -21,7 +21,7 @@ GEM
specs:
awesome_print (1.9.2)
base64 (0.3.0)
bigdecimal (3.2.3)
bigdecimal (3.3.1)
bump (0.10.0)
coderay (1.1.3)
csv (3.3.5)
Expand All @@ -42,7 +42,7 @@ GEM
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
json (2.15.0)
json (2.15.1)
jsonpath (1.1.5)
multi_json
logger (1.7.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Commands:
publish PACT_DIRS_OR_FILES ... # Publish pacts to a Pact Broker.
stub-server # Run a Pact stub server
stub-service # (legacy) Run a Pact stub service
verifier # Run a Pact verifier
verifier # Verify pact(s) against a provider. Supports local and networked (http-based) files.
verify PACT_URL ... # (legacy) Verify pact(s) against a provider. Supports local and networked (http-based) files.
version # Print the version of the CLI

Expand Down
4 changes: 2 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

PACT_COMMANDS=" broker help mock-service publish stub-service verify version verifier mock-server stub-server plugin "
PACT_RUST_COMMANDS=" pact-plugin-cli pact-stub-server pact_mock_server_cli pact_verifier_cli "
PACT_COMMANDS=" broker broker-cli help mock-service publish publish-cli stub-service verify version verifier mock-server stub-server plugin "
PACT_RUST_COMMANDS=" pact-plugin-cli pact-stub-server pact_mock_server_cli pact_verifier_cli pact-broker-cli "

# git branch detection command fails due to cve fix https://github.blog/2022-04-12-git-security-vulnerability-announced/
# fatal: unsafe repository (REPO is owned by someone else) in other workflow steps after running checkout
Expand Down
27 changes: 22 additions & 5 deletions lib/pact/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ def stub_service
Pact::StubService::CLI.start(process_argv("stub-service"))
end

desc 'pact-broker', 'Interact with a Pact Broker (also aliased as the subcommand `broker`)'
desc 'pact-broker', '(legacy) Interact with a Pact Broker (also aliased as the subcommand `broker`) - use `pact-broker-cli` subcommand instead'
def pact_broker
::PactBroker::Client::CLI::Broker.start(process_argv("pact-broker"))
end

desc 'broker', 'Interact with a Pact Broker (this command is still supported by has been superseded by the pact-broker command for consistency across the various packages', hide: true
desc 'broker', '(legacy) Interact with a Pact Broker (this command is still supported by has been superseded by the pact-broker command for consistency across the various packages - use `pact-broker-cli` subcommand instead', hide: true
def broker
::PactBroker::Client::CLI::Broker.start(process_argv("broker"))
end

desc 'pactflow', 'Interact with PactFlow'
desc 'pactflow', '(legacy) Interact with PactFlow - use `pact-broker-cli pactflow` subcommand instead'
def pactflow
::Pactflow::Client::CLI::Pactflow.start(process_argv("pactflow"))
end
Expand All @@ -64,13 +64,22 @@ def verify
Pact::ProviderVerifier::CLI::Verify.start(process_argv(""))
end

desc ::PactBroker::Client::CLI::Broker.commands["publish"].usage, ::PactBroker::Client::CLI::Broker.commands["publish"].description
desc ::PactBroker::Client::CLI::Broker.commands["publish"].usage, "(legacy) " + ::PactBroker::Client::CLI::Broker.commands["publish"].description
long_desc ::PactBroker::Client::CLI::Broker.commands["publish"].long_description

def publish
::PactBroker::Client::CLI::Broker.start(process_argv(""))
end

desc 'publish-cli', 'Publish pacts to a Pact Broker.'
def publish_cli
ARGV.shift
output = `./bin/pact-broker-cli publish #{ARGV.join(" ")}`
exit_status = $?.exitstatus
puts output
exit(exit_status)
end

desc "version", "Print the version of the CLI"
def version
require 'pact/cli/version'
Expand All @@ -84,7 +93,7 @@ def plugin
puts output
exit(exit_status)
end
desc 'verifier', 'Run a Pact verifier'
desc 'verifier', 'Verify pact(s) against a provider. Supports local and networked (http-based) files.'
def verifier
ARGV.shift
output = `./bin/pact_verifier_cli #{ARGV.join(" ")}`
Expand Down Expand Up @@ -114,6 +123,14 @@ def stub_server
exit(exit_status)
end
end
desc 'pact-broker-cli', 'Interact with a Pact Broker'
def broker_cli
ARGV.shift
output = `./bin/pact-broker-cli #{ARGV.join(" ")}`
exit_status = $?.exitstatus
puts output
exit(exit_status)
end
no_commands do
def self.exit_on_failure?
true
Expand Down
2 changes: 1 addition & 1 deletion pact-cli.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "pact-provider-verifier"
spec.add_dependency "pact_broker-client", "~> 1.28"
spec.add_dependency "json", "~>2.15" # must match native lib install in the Dockerfile
spec.add_dependency "bigdecimal", "~>3.2" # must match native lib install in the Dockerfile
spec.add_dependency "bigdecimal", "~>3.3" # must match native lib install in the Dockerfile

spec.add_dependency "rack-test", ">= 0.6.3", "< 3.0.0"

Expand Down