Skip to content

Commit aafb20e

Browse files
author
Jonathan Gaillard
committed
Merge pull request #28 from nubs/master
Use fig instead of dockerBuild.php.
2 parents fdeff23 + 07807c4 commit aafb20e

7 files changed

Lines changed: 26 additions & 38 deletions

File tree

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,20 @@ Developers may be contacted at:
5353
* [Pull Requests](https://github.com/dominionenterprises/mongo-queue-php/pulls)
5454
* [Issues](https://github.com/dominionenterprises/mongo-queue-php/issues)
5555

56-
##Tests
57-
58-
Install and start [mongodb](http://www.mongodb.org).
59-
With a checkout of the code get [Composer](http://getcomposer.org) in your PATH and run:
56+
##Contributing
57+
58+
If you would like to contribute, please use our build process for any changes
59+
and after the build passes, send us a pull request on github! The build
60+
requires a running mongo. The URI to mongo can be specified via an environment
61+
variable or left to its default (localhost on the default port, 27017):
62+
```sh
63+
TESTING_MONGO_URL=mongodb://127.0.0.1:27017 ./build.php
64+
```
6065

61-
```bash
62-
php build.php
66+
There is also a [docker](http://www.docker.com/)-based
67+
[fig](http://www.fig.sh/) configuration that will standup a docker container
68+
for the database, execute the build inside a docker container, and then
69+
terminate everything. This is an easy way to build the application:
70+
```sh
71+
fig run build
6372
```

dockerBuild.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

fig.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build:
2+
build: tests
3+
links:
4+
- mongo
5+
volumes:
6+
- .:/code
7+
mongo:
8+
image: mongo
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
2-
if test -z "${MONGO_PORT_27017_TCP_ADDR}" -o -z "${MONGO_PORT_27017_TCP_PORT}"; then
2+
if test -z "${MONGO_1_PORT_27017_TCP_ADDR}" -o -z "${MONGO_1_PORT_27017_TCP_PORT}"; then
33
echo "You must link this container with mongo first"
44
exit 1
55
fi
66

7-
export TESTING_MONGO_URL="mongodb://${MONGO_PORT_27017_TCP_ADDR}:${MONGO_PORT_27017_TCP_PORT}"
7+
export TESTING_MONGO_URL="mongodb://${MONGO_1_PORT_27017_TCP_ADDR}:${MONGO_1_PORT_27017_TCP_PORT}"
88

99
# See http://tldp.org/LDP/abs/html/devref1.html for description of this syntax.
10-
while ! exec 6<>/dev/tcp/${MONGO_PORT_27017_TCP_ADDR}/${MONGO_PORT_27017_TCP_PORT}; do
10+
while ! exec 6<>/dev/tcp/${MONGO_1_PORT_27017_TCP_ADDR}/${MONGO_1_PORT_27017_TCP_PORT}; do
1111
echo "$(date) - still trying to connect to mongo at ${TESTING_MONGO_URL}"
1212
sleep 1
1313
done

0 commit comments

Comments
 (0)