This repository deploys Pact Broker using lightweight containers using Docker. You can pull the dius/pact-broker image from Dockerhub.
timeout or gtimeout function. You can install gtimeout using brew install coreutils.export DISPOSABLE_PSQL=true before running the script/test.sh.For a postgres or mysql database:
* PACT_BROKER_DATABASE_ADAPTER (optional, defaults to 'postgres', see note below.)
* PACT_BROKER_DATABASE_USERNAME
* PACT_BROKER_DATABASE_PASSWORD
* PACT_BROKER_DATABASE_HOST
* PACT_BROKER_DATABASE_NAME
Adapter can be 'postgres' (recommended) or 'mysql2' (please note that future JSON search features may not be supported on mysql).
For an sqlite database (only recommended for investigation/spikes, as it will be disposed of with the container unless you mount it from an external file system):
-p 80:80 to start the docker image, as some of the Rack middleware gets confused by receiving requests for other ports and will return a 404 otherwise (port forwarding does not rewrite headers).docker-machine ip $(docker-machine active) to get the IP of the VirtualBox, and connect on port 80.To enable basic auth, run your container with:
PACT_BROKER_BASIC_AUTH_USERNAMEPACT_BROKER_BASIC_AUTH_PASSWORDPACT_BROKER_BASIC_AUTH_READ_ONLY_USERNAMEPACT_BROKER_BASIC_AUTH_READ_ONLY_PASSWORDDevelopers should use the read only credentials on their local machines, and the CI should use the read/write credentials. This will ensure that pacts and verification results are only published from your CI.
Note that the verification status badges are not protected by basic auth, so that you may embed them in README markdown.
If you are using the docker container within an AWS autoscaling group, and you need to make a heartbeat URL publicly available, set PACT_BROKER_PUBLIC_HEARTBEAT=true. No database connection will be made during the execution of this endpoint.
See the Pact Broker configuration documentation.
Set the environment variable PACT_BROKER_LOG_LEVEL to one of DEBUG, INFO, WARN, ERROR, or FATAL.
github.com), network ranges (eg. 10.2.3.41/24, or regular expressions (eg. /.*\\.foo\\.com$/). Regular expressions should start and end with a / to differentiate them from Strings. Note that backslashes need to be escaped with a second backslash. Please read the Webhook whitelists section of the Pact Broker configuration documentation to understand how the whitelist is used. Remember to use quotes around this value as it may have spaces in it.http https). Defaults to https.true by default, may be set to false.true by default, may be set to false.Documentation for the Pact Broker application itself can be found in the Pact Broker wiki.
For a quick start with the Pact Broker and Postgres, we have an example Docker Compose setup you can use:
docker-compose.yml file as required.docker-compose up to get a running Pact Broker and a clean Postgres databaseNow you can access your local broker:
curl -v http://localhost # you can visit in your browser too!
# SSL endpoint, note that URLs in response contain https:// protocol
curl -v -k https://localhost:8443
NOTE: this image should be modified before using in Production, in particular, the use of hard-coded credentials
See pact-broker-openshift for an example config file.
See the Troubleshooting page on the wiki.
Content type
Image
Digest
Size
321.7 MB
Last updated
about 8 years ago
docker pull nandess/pactbroker-docker:2.16.1.beta