Hi all, Instead of using Pact-Cli image in my CICD...
# pact-broker
p
Hi all, Instead of using Pact-Cli image in my CICD pipeline, I am using an Pact-Cli executable (referring to this link - https://github.com/pact-foundation/pact-ruby-standalone/releases) _"curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.0.3/pact-2.0.3-linux-x86_64.tar.gz_ _tar xzf pact-2.0.3-linux-x86_64.tar.gz"_ My question here is, after unpacking the tar ball, what are the commands I need to add in my CICD job to use the executable to publish the verified pacts back to pact broker.
y
you will need to add the path to the executable, or add it to your PATH, so the command is globally available
p
This is what I have done so far. Can you tell me where exactly I need to add the path? @Yousaf Nabi (pactflow.io)
y
Copy code
export PACT_CLI_BIN_PATH=${PWD}/pact/bin/
export PATH=$PACT_CLI_BIN_PATH:${PATH}
p
Do we need to put these commands in the CICD pipeline? I tired adding it after curl command and before "pact-broker" command in the job.
Copy code
export PACT_CLI_BIN_PATH=${PWD}/pact/bin/
export PATH=$PACT_CLI_BIN_PATH:${PATH}
y
the path to the executables are in
pact/bin
once you have downloaded them. therefore the path to the executable can be
pact/bin/pact-broker
from your current working directory.
p
I am able to download the executable (as seen from the job logs), how can I navigate to pact/bin/pact-broker and use the pact broker command?
y
you can just do pact/bin/pact-broker publish …
✅ 1
p
Thank you so much! I am now able to use the pact-cli executable 🙂
y
great stuff, thx for confirming