pact-foundation / pact.io

Pact Foundation Website
http://pact.io
Other
219 stars 93 forks source link

Diagram CI/CD infrastructure #64

Open TimothyJones opened 5 years ago

TimothyJones commented 5 years ago

How best to setup the CI/CD infrastructure is a common question. We could more easily answer these with a diagram or two in the documentation.

TodorGinchev commented 5 years ago

Yes, if someone has the time to do it, that would be very helpful.

bethesque commented 5 years ago

Here is a starting point https://github.com/pact-foundation/pact_broker/wiki/Webhooks

mellowplace commented 4 years ago

I have a specific question on CICD - I assume most people on both the consumer side and provider side use can-i-deploy before releasing to production.

How do you get past the chicken and the egg problem of not having any pacts published or verified when creating a new provider?

TimothyJones commented 4 years ago

In my experience, these checks aren't set up yet when we first deploy a new consumer and provider pair.

However, if you want to set up the checks before first deployment, you could always verify the pacts and manually tag the intended deployment version as "production".

I don't think it's a large concern, because if your service isn't deployed at all, no one is using it.

If the consumer already exists in production, then you would push the version that can speak to the new provider before deploying the provider.

You may find the diagrams here helpful:

https://docs.pact.io/getting_started/versioning_in_the_pact_broker

if you have further questions, I recommend joining us on slack at slack.pact.io

bethesque commented 4 years ago

@mellowplace there used to be a bug in the Pact Broker that wouldn't let you deploy the provider if there were missing pacts. I've fixed that recently. If you upgrade to the latest version, you shouldn't have this problem.

If it's a totally new service, and doesn't even exist in the broker yet, but you're calling can-i-deploy because it's part of a standard deployment script, then add a curl http://broker/pacticipants/{NAME} check to see if the resource for that service exists before calling can-i-deploy.