The link to `Publishing` under Pact JS here is bro...
# pactflow
j
The link to
Publishing
under Pact JS here is broken https://docs.pact.io/getting_started/sharing_pacts#language-support Where is the documentation for publishing to pactflow in Pact JS?
or I assume we are to just use the broker CLI here? https://docs.pact.io/pact_broker/client_cli/readme
y
Apologies about that! Yes its generally recommend to use the standalone cli tools 👍 If you are using pact-js, it contains pact-js-core, which exposes the cli tools as npm bin stubs https://github.com/pact-foundation/pact-js-core?tab=readme-ov-file#cli-tools there is also an api exposed for programatic use, but I wouldn’t recommend that approach now, as we are more than likely due to deprecate that in the future. The bin stubs will be exposed in https://github.com/pact-foundation/pact-js-cli which is still due to be published (just a wrapper over the cli tools) - not sure if we should expose the programmatic api here as well (I think we would rather avoid it, to avoid maintainence efforts) Will look to sort those links so they point to the relevant bits
j
Since we use nodejs in our backend along with docker compose, the docker cli solution works perfectly actually
🙌 1
thanks for clarifying though!
b
@Joel Whalen did you have any problem with mounting volume using docker cli approach ?
docker run --rm \ -w $(Build.SourcesDirectory)/$(bffFolder)/src/pacts \ -v $(Build.SourcesDirectory)/$(bffFolder)/src/pacts:$(Build.SourcesDirectory)/$(bffFolder)/src/pacts \ -e PACT_BROKER_BASE_URL="url" \ -e PACT_BROKER_TOKEN="token" \ pactfoundation/pact-cli:latest \ publish \ $(Build.SourcesDirectory)/$(bffFolder)/src/pacts/pact.json --consumer-app-version=$(version.packageSemVer) this command is nor working for me, saying that file does not have permissions..
Im tyring to run it in azure devops pipeline
j
If CI doesn't have write permissions, you need to give it permission to write to that file or folder. I don't know how to configure that in Azure, but I'm sure they have documentation for that. As for docker volumes, I was using docker compose and put my API as one service, and the pact cli image as another service. Then in the highest level of the docker compose file, you want to define a shared volume between the two like so: volumes: my-shared-volume: Then define 'my-shared-volume' in each services volumes key