Sha256: 1684fd001b1363b0170037e4a8edfffdead4dbb552713eddac143e3df2f7cfd3

Contents?: true

Size: 1.7 KB

Versions: 89

Compression:

Stored size: 1.7 KB

Contents

# Run Pact Broker example

The configuration for this example should not be used in production. Either use the [Docker Pact Broker image][docker-pact-broker], or copy the [pact_broker directory][pact-broker-dir] from the Docker project as your starting point. Ensure you configure a web server/reverse proxy (such as Passenger/Nginx) in front of it (you can also copy the configuration for these from the Docker image.)

Clone project

```bash
git clone https://github.com/pact-foundation/pact_broker
```

Change directory to `example`

```bash
cd pact_broker/example
```

## Run with sqlite database

Install dependencies

```bash
bundle install
```

Run Pact Broker

```bash
bundle exec rackup
```

## Run with postgres database

Uncomment `gem 'pg'` in the [Gemfile](Gemfile)

Comment out `gem 'sqlite3'` in the [Gemfile](Gemfile)

Comment out the line with `DATABASE_CREDENTIALS = {adapter: "sqlite"...` in the [config.ru](config.ru#L9).

Uncomment the line with `DATABASE_CREDENTIALS = {adapter: "postgres"...`. in the [config.ru](config.ru#L17).

Set up postgres database

```bash
psql postgres -c "CREATE DATABASE pact_broker;"
psql postgres -c "CREATE ROLE pact_broker WITH LOGIN PASSWORD 'CHANGE_ME';"
psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE pact_broker TO pact_broker;"
```

Install dependencies

```bash
bundle install
```

Run Pact Broker

```bash
bundle exec rackup
```

If you need an example data run following command

```bash
psql pact_broker < example_data.sql
```

Now Pact Broker can be access locally at [http://localhost:9292](http://localhost:9292).

[docker-pact-broker]: https://github.com/DiUS/pact_broker-docker
[pact-broker-dir]: https://github.com/DiUS/pact_broker-docker/tree/master/pact_broker

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
pact_broker-2.81.0 example/README.md
pact_broker-2.80.0 example/README.md
pact_broker-2.79.1 example/README.md
pact_broker-2.79.0 example/README.md
pact_broker-2.78.1 example/README.md
pact_broker-2.78.0 example/README.md
pact_broker-2.77.0 example/README.md
pact_broker-2.76.2 example/README.md
pact_broker-2.76.1 example/README.md
pact_broker-2.76.0 example/README.md
pact_broker-2.75.0 example/README.md
pact_broker-2.74.1 example/README.md
pact_broker-2.74.0 example/README.md
pact_broker-2.73.0 example/README.md
pact_broker-2.72.0 example/README.md
pact_broker-2.71.0 example/README.md
pact_broker-2.70.0 example/README.md
pact_broker-2.69.0 example/README.md
pact_broker-2.68.1 example/README.md
pact_broker-2.68.0 example/README.md