Closed YOU54F closed 2 years ago
https://github.com/pactflow/roadmap/issues/68
The ability to publish a provider contract (such as an OAS) and verification results to Pactflow via a CLI.
Step 4 in our BDCT provider testing guide API documentation for call & Example
pactflow publish-provider-contract
Steps to use
docker pull pactfoundation/pact-cli:0.50.0.26
--env PACTFLOW_FEATURES=publish-provider-contract
PACTFLOW_FEATURES=publish-provider-contract
OAS_FILE_PATH?=oas/products.yml REPORT_FILE_PATH?=output/report.md REPORT_FILE_CONTENT_TYPE?=text/plain VERIFIER_TOOL?=dredd
and the usual vars
PACT_BROKER_BASE_URL= PACT_BROKER_TOKEN= PACTICIPANT= VERSION= BRANCH=
docker run --rm \ -v "${APPDIR}":/app \ -w "/app" \ -e PACT_BROKER_BASE_URL \ -e PACT_BROKER_TOKEN \ -e PACTFLOW_FEATURES=publish-provider-contract \ pactfoundation/pact-cli:0.50.0.26 \ pactflow publish-provider-contract \ /app/$OAS_FILE_PATH \ --provider $PACTICIPANT \ --provider-app-version $VERSION \ --branch $BRANCH \ --content-type application/yaml \ --verification-exit-code=$1 \ --verification-results /app/$REPORT_FILE_PATH \ --verification-results-content-type $REPORT_FILE_CONTENT_TYPE\ --verifier $VERIFIER_TOOL
This can be updated to 0.50.0.27 without the PACTFLOW_FEATURES env var now.
Improvements to Provider Contract Publishing
https://github.com/pactflow/roadmap/issues/68
Original Pages from Docs:-
Step 4 in our BDCT provider testing guide API documentation for call & Example
Example of usage of pact cli
pactflow publish-provider-contract
commandSteps to use
docker pull pactfoundation/pact-cli:0.50.0.26
--env PACTFLOW_FEATURES=publish-provider-contract
PACTFLOW_FEATURES=publish-provider-contract
and the usual vars