Hi all, what is the best way to upload more than o...
# pactflow
n
Hi all, what is the best way to upload more than one pact in github workflows? So far in my consumer github workflows I have a few simple commands just to publish a single pact and run can-i-deploy. But What if I am in a monorepo and there may be several different files where there are many pacts in each file and they may all have different providers and names? How can I scale this to a more realistic CI flow? I saw that some examples were using bash scripts but was not entirely sure what for?
y
the pact-broker publish command will publish a single pact, or any pacts in a directory. You are pointing it to the
./pacts
directory in your screenshot. The
trigger-cross-test
is a workflow designed for testing our examples via GitHub actions against different operating systems, and methods of upload ( standalone cli, ruby cli and dockerised cli )
The pact publish command will perform duplicate detection, so if you create a pact files for the same consumer/provider pair, with different interactions, they will all be uploaded under the version/branch/tag associated with the publish command
it will dedupe interactions too
n
But what about the can-i-deploy command? It needs the
--pacticipant
right? How would I be able to run that command and have it check multiple pacts with different providers and consumers??
b
@Noor Hashem you give it multiple names.
Copy code
pact-broker can-i-deploy --pacticipant monorepo-app-1 --version 1 --pacticipant monorepo-app-2 --version 1 ... --to-environment test
n
Oh I see, this is great thanks!