Skip to content

Commit

Permalink
Merge pull request #196 from pact-foundation/fix/docker_compose
Browse files Browse the repository at this point in the history
fix(ci): docker-compose possibly causing issues
  • Loading branch information
YOU54F authored Jun 25, 2024
2 parents f17f6bc + 2a63a60 commit 2fa1a4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ If you are running more than one Pact Broker Docker container at a time for the
You can see a working example in the [docker-compose-clean.yml](./docker-compose-clean.yml) file. To run the example locally, run:

```
docker-compose -f docker-compose-clean.yml up pact-broker
docker compose -f docker-compose-clean.yml up pact-broker
# in another console
docker-compose -f docker-compose-clean.yml up clean
docker compose -f docker-compose-clean.yml up clean
```

### Known issues with the data clean up task
Expand All @@ -173,8 +173,8 @@ For a quick start with the Pact Broker and Postgres, we have an example
[Docker Compose][docker-compose] setup you can use:

1. Modify the `docker-compose.yml` file as required.
2. Run `docker-compose build` to build the pact_broker container locally.
3. Run `docker-compose up` to get a running Pact Broker and a clean Postgres database.
2. Run `docker compose build` to build the pact_broker container locally.
3. Run `docker compose up` to get a running Pact Broker and a clean Postgres database.

Now you can access your local broker:

Expand Down
2 changes: 1 addition & 1 deletion example-k8s-deployment/infrastructure/deploy_cfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
stack=$1
env=$2

docker-compose run --rm stackup-"$env" pact-broker-"$stack" up \
docker compose run --rm stackup-"$env" pact-broker-"$stack" up \
-t infrastructure/"$stack"/template.yaml \
-p infrastructure/"$stack"/envs/common.yaml \
-p infrastructure/"$stack"/envs/"$env".yaml
10 changes: 5 additions & 5 deletions script/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ for file in $docker_compose_files; do
done

cleanup() {
docker-compose -f docker-compose-tests.yml rm -fv || true
docker-compose -f docker-compose-test-different-env-var-names.yml rm -fv || true
docker compose -f docker-compose-tests.yml rm -fv || true
docker compose -f docker-compose-test-different-env-var-names.yml rm -fv || true
}
trap cleanup EXIT

cleanup

docker-compose -f docker-compose-tests.yml up --build --abort-on-container-exit --exit-code-from sut --remove-orphans
docker compose -f docker-compose-tests.yml up --build --abort-on-container-exit --exit-code-from sut --remove-orphans
cleanup

export PACT_BROKER_BASIC_AUTH_USERNAME=foo
export PACT_BROKER_BASIC_AUTH_PASSWORD=bar
export PACT_BROKER_PUBLIC_HEARTBEAT=true
docker-compose -f docker-compose-tests.yml up --build --abort-on-container-exit --exit-code-from sut --remove-orphans
docker compose -f docker-compose-tests.yml up --build --abort-on-container-exit --exit-code-from sut --remove-orphans

unset PACT_BROKER_BASIC_AUTH_USERNAME
unset PACT_BROKER_BASIC_AUTH_PASSWORD
unset PACT_BROKER_PUBLIC_HEARTBEAT

docker-compose -f docker-compose-test-different-env-var-names.yml up --build --abort-on-container-exit --exit-code-from sut --remove-orphans
docker compose -f docker-compose-test-different-env-var-names.yml up --build --abort-on-container-exit --exit-code-from sut --remove-orphans

0 comments on commit 2fa1a4c

Please sign in to comment.