-
Notifications
You must be signed in to change notification settings - Fork 216
Sharing pacts between consumer and provider
You want to ensure that the provider has access to the latest version of the pact at all times. There are a few ways you can do this, depending on your requirements.
Pretty self explanatory.
Work out the URL to the pact created by the most recent successful build, and configure the pact:verify
task to point to this URL.
This only works for repositories that don't require authentication to read. Make sure that you always regenerate the pacts before committing if you make any changes to the pact specs, and that the specs are always passing before you commit, because you don't want to verify the pact from a broken build.
The Pact Broker is a repository for sharing pacts between projects. It also provides:
- Auto-generated documentation
- Dynamically generated network diagrams
- The ability to tag a pact (ie. "prod") so a provider can verify itself against a fixed version of a pact to ensure backwards compatibility.
- Webhooks to trigger provider builds when a pact is published.
If you want to decouple the release cycle of your consumer and provider, and be able to cross test the head/prod versions of each, then the Pact Broker is the best solution for you.