https://pact.io logo
#general
Title
# general
l

LAV JOSHI

05/27/2022, 5:33 AM
Hi everyone, I am setting up this repository https://github.com/pactflow/example-consumer locally on my machine. I have created the PACT_BROKER_TOKEN and PACT_BROKER_BASE_URL, DOCKER, and MAKE but while running the command make fake_ci this error is showing up. Can anyone help me with this issue? 'CI' is not recognized as an internal or external command, operable program or batch file. make: * [fake_ci] Error 1
t

Timothy Jones

05/27/2022, 5:38 AM
This sounds like a windows error. What shell are you running? I don't know if this is the problem, but does it work if you try from
bash
?
☝️ 1
It looks like
SHELL=/bin/bash
(or similar) might be helpful https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html
👍 2
l

LAV JOSHI

05/27/2022, 6:00 AM
Yes solved, thanks!
t

Timothy Jones

05/27/2022, 6:14 AM
@Matt (pactflow.io / pact-js / pact-go) I think you can put the
SHELL=/bin/bash
line in the makefile, solving this for everyone, maybe
👍 1
l

LAV JOSHI

05/27/2022, 6:56 AM
I am running the command, and another error is showing up is of Docker. I am new to Docker. Can you help on this. \n========== STAGE: publish pacts ==========\n docker: Error response from daemon: invalid mode: /Pact/example-consumer. See 'docker run --help'. make[1]: * [publish_pacts] Error 125
Try changing:
Copy code
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli"
to
Copy code
PACT_CLI="docker run --rm -v "/$(PWD):$(PWD)" -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli"
...maybe. I don't have a windows machine to test on
oh, actually, does your path have spaces in it? It might be enough to just quote those variables
☝️ 1
m

Matt (pactflow.io / pact-js / pact-go)

05/27/2022, 8:02 AM
The examples aren’t very windows friendly are they.
Glad running it with bash helped though.
Where are you running these docker commands - from which shell environment? I think it needs to be run in something like git shell?
I’m going to see if we can get a windows build running next week, so at least we have a working example to show Windows users
l

LAV JOSHI

05/27/2022, 9:57 AM
@Matt (pactflow.io / pact-js / pact-go) running in git shell only
But same error is coming from local and it is not pushing the contract to pactflow. It's working fine from github build workflow.
m

Matt (pactflow.io / pact-js / pact-go)

05/27/2022, 10:00 AM
Thanks. By any chance are there spaces in the project path?
l

LAV JOSHI

05/27/2022, 10:09 AM
No
Copy code
PACT_CLI="docker run --rm -v "/$(PWD):$(PWD)" -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli"
Tried this as well
But the same error is coming
m

Matt (pactflow.io / pact-js / pact-go)

05/27/2022, 10:41 AM
So the
${PWD}:${PWD}
part of that command says “mount the current directory into the container, at the same path”. See if you can replace the
PWD
with the correct folder path for the source (i.e. your machine) and target (the container).
👍 1
6 Views