Adam Lukačka
09/20/2022, 12:44 PMcan-i-deploy
passes new contract is published to pact broker (this is in build pipeline)
• this publishes contract e.g. consumer 1.0 & provider 1.0
◦ when I deploy consumer 1.1
this will publish contract consumer 1.1 & provider 1.0
◦ when I deploy consumer 1.2
this will publish contract consumer 1.2 & provider 1.0
now my question is if I deploy provider 1.1
how do I publish new contract between consumer and provider?
I guess in this case if we follow the above example if provider 1.1
is deployed then contract between consumer 1.2 & provider 1.1
should be published? how do I publish this new contract new consumer builds? or am I missing something?Boris
09/21/2022, 2:02 AMBoris
09/21/2022, 2:03 AMMatt (pactflow.io / pact-js / pact-go)
when consumer service is built and can-i-deploy passes new contract is published to pact broker (this is in build pipeline)
this publishes contract e.g. consumer 1.0 & provider 1.0Publishing should happen before running
can-i-deploy
and deployment of code.
You should publish on every build, and use branches and releases to document what you are working on, and when you have deployed.
You then use consumer version selectors on the provider side, to verify the appropriate contracts.
when I deploy consumer 1.1 this will publish contract consumer 1.1 & provider 1.0See above. If you deploy a consumer 1.1 that should use the
record-deployment
command. This can only happen after publishing of a contract
when I deploy consumer 1.2 this will publish contract consumer 1.2 & provider 1.0as per above.
now my question is if I deploy provider 1.1 how do I publish new contract between consumer and provider?
I guess in this case if we follow the above example if provider 1.1 is deployed then contract between consumer 1.2 & provider 1.1 should be published? how do I publish this new contract new consumer builds? or am I missing something?No, you don’t. The contract is published from the consumer always. The provider verifies the contracts. If there is a new version, you just push the code and let it verify any existing contracts. I’d recommend https://docs.pact.io/pact_nirvana and the CI/CD workshop