Skip to content

Commit 4ee6f7e

Browse files
setup a docker config
1 parent 9246c7c commit 4ee6f7e

File tree

5 files changed

+31
-12
lines changed

5 files changed

+31
-12
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM nodesource/node:4.2
2+
3+
ADD package.json package.json
4+
RUN npm install
5+
ADD . .

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
adapter:
2+
build: .
3+
volumes:
4+
- .:/usr/src/app
5+
links:
6+
- postgres
7+
8+
postgres:
9+
image: postgres:9.4
10+
environment:
11+
- POSTGRES_PASSWORD=sails
12+
- POSTGRES_USER=sails
13+
- POSTGRES_DB=sailspg

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"waterline-adapter-tests": "0.10.18"
3030
},
3131
"scripts": {
32-
"test": "make test"
32+
"test": "make test",
33+
"docker": "docker-compose run adapter bash"
3334
},
3435
"main": "lib/adapter",
3536
"directories": {

test/integration/runner.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ new TestRunner({
6969

7070
// Default connection config to use.
7171
config: {
72-
host: 'localhost',
73-
user: process.env.DB_USER || 'root',
74-
password: process.env.DB_PASS || '',
75-
database: 'sailspg',
76-
port: 5432,
72+
host: process.env.POSTGRES_1_PORT_5432_TCP_ADDR || process.env.WATERLINE_ADAPTER_TESTS_HOST || 'localhost',
73+
user: process.env.WATERLINE_ADAPTER_TESTS_USER || 'sails',
74+
password: process.env.WATERLINE_ADAPTER_TESTS_PASSWORD || 'sails',
75+
database: process.env.WATERLINE_ADAPTER_TESTS_DATABASE || 'sailspg',
76+
port: process.env.WATERLINE_ADAPTER_TESTS_PORT || 5432,
7777
schema: true,
7878
ssl: false
7979
},
@@ -82,7 +82,7 @@ new TestRunner({
8282
// The set of adapter interfaces to test against.
8383
// (grabbed these from this adapter's package.json file above)
8484
interfaces: interfaces,
85-
85+
8686
// The set of adapter features to test against.
8787
// (grabbed these from this adapter's package.json file above)
8888
features: features,

test/unit/support/bootstrap.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Support.SqlOptions = {
1919
};
2020

2121
Support.Config = {
22-
host: 'localhost',
23-
user: process.env.DB_USER || 'root',
24-
password: process.env.DB_PASS || '',
25-
database: 'sailspg',
26-
port: 5432
22+
host: process.env.POSTGRES_1_PORT_5432_TCP_ADDR || process.env.WATERLINE_ADAPTER_TESTS_HOST || 'localhost',
23+
user: process.env.WATERLINE_ADAPTER_TESTS_USER || 'sails',
24+
password: process.env.WATERLINE_ADAPTER_TESTS_PASSWORD || 'sails',
25+
database: process.env.WATERLINE_ADAPTER_TESTS_DATABASE || 'sailspg',
26+
port: process.env.WATERLINE_ADAPTER_TESTS_PORT || 5432
2727
};
2828

2929
// Fixture Collection Def

0 commit comments

Comments
 (0)