Hello ! I'm trying to setup my consumer and provid...
# pact-jvm
r
Hello ! I'm trying to setup my consumer and provider using these two examples: • https://github.com/pactflow/example-consumer-java-kafka • https://github.com/pactflow/example-provider-java-kafka I'm having issues with my contract generation. I don't see it locally and its not getting published to my packflow.io page. Make start / make test-events, localhost its all fine on the consumer project but I'm getting the following error on provider: java.lang.RuntimeException: Could not resolve property "PACT_BROKER_HOST" in the system properties or environment variables and no default value is supplied. Has anyone experienced these issues before? Thanks for your help!
m
Have you set that environment variable?
You can see how it should be set by reviewing the GitHub actions build setup
r
thank you @Matt (pactflow.io / pact-js / pact-go) for the information! The env variables were set in my terminal with the following commands: PACT_BROKER_BASE_URL="https://mypacthere.pactflow.io" PACT_BROKER_TOKEN="mytockenhere" I'm getting this error šŸ˜• rstolarc@xxxx example-consumer-java-kafka % GIT_BRANCH=${GIT_REF:11} make publish_pacts Unable to find image 'pactfoundation/pact-cli:latest' locally latest: Pulling from pactfoundation/pact-cli docker: no matching manifest for linux/arm64/v8 in the manifest list entries. See 'docker run --help'. make: * [publish_pacts] Error 125
m
I think it's arm64 that's the issue. I don't think we currently support or build that target
I know @Yousaf Nabi (pactflow.io) had done a heap of work to support X platform builds so hopefully not too far away
You might be able to emulate another combo using the --platform docker arg
šŸ‘ 1
y
you can use the vanilla image with platform=linux/amd64 otherwise you can append -multi to the tag and get a platform specific image
šŸ‘ 1
r
I was able to fix the issue with updating the make file
Copy code
PACTICIPANT := "pactflow-example-consumer-java-kafka"
GITHUB_WEBHOOK_UUID := "654aff47-0269-4b9f-aaca-2f83ff3cd772"
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli:latest-multi"
I'm still looking how to generate the pacts. Getting this error now: rstolarc@xxxx example-consumer-java-kafka % make publish_pacts No value provided for option '--consumer-app-version' make: * [publish_pacts] Error 1
y
you are trying to run a script that is setup for CI, and the env vars GIT_COMMIT and GIT_BRANCH set
or you can set them yourself in your shell
the error message is very clear
r
Thank you Yousaf ! I have the consumer working. When I try to run the tests or fake_ci for provider, I get the following error; java.lang.RuntimeException: Could not resolve property "PACT_BROKER_HOST" in the system properties or environment variables and no default value is supplied. Looking for where its missing.
I did the following and still are seeing the issue: export PACT_BROKER_HOST="https://mytest.pactflow.io" export PACT_BROKER_TOKEN="testtoken" PACT_BROKER_HOST and PACT_BROKER_TOKEN (Provider Variables) are the same variables as PACT_BROKER_BASE_URL and PACT_BROKER_TOKEN (Consumer Variables)?