Browse Source

Add docker-compose file for tests

master
Chris Smith 7 years ago
parent
commit
7a0c3dd455
3 changed files with 28 additions and 9 deletions
  1. 5
    5
      README.md
  2. 6
    4
      circle.yml
  3. 17
    0
      test/docker-compose.yml

+ 5
- 5
README.md View File

@@ -10,12 +10,12 @@ and labels) that the reporter service creates.
10 10
 ## Tests [![CircleCI](https://circleci.com/gh/csmith/docker-service-reporter-lib.svg?style=svg)](https://circleci.com/gh/csmith/docker-service-reporter-lib)
11 11
 
12 12
 A separate Dockerfile for tests is located in the tests directory. It depends
13
-on a 'dev' label of csmith/service-reporter-lib. You can build and run the
14
-tests like so:
13
+on a 'dev' label of csmith/service-reporter-lib. There's a docker compose file
14
+to build them together:
15 15
 
16 16
 ```
17
-docker build -t csmith/service-reporter-lib:dev .
18
-docker build -t csmith/service-reporter-lib-test:dev test
19
-docker run --rm -it csmith/service-reporter-lib-test:dev
17
+cd test
18
+docker-compose build
19
+docker-compose run tests
20 20
 ```
21 21
 

+ 6
- 4
circle.yml View File

@@ -4,12 +4,14 @@ machine:
4 4
     - docker
5 5
 
6 6
 dependencies:
7
+  pre:
8
+    - pip install docker-compose
7 9
   override:
8
-    - docker info
9
-    - docker build -t csmith/service-reporter-lib:dev .
10
-    - docker build -t csmith/service-reporter-lib-test:dev test
10
+    - docker-compose build
11
+  pwd: test
11 12
 
12 13
 test:
13 14
   override:
14
-    - docker run -it csmith/service-reporter-lib-test:dev
15
+    - docker-compose run tests
16
+  pwd: test
15 17
 

+ 17
- 0
test/docker-compose.yml View File

@@ -0,0 +1,17 @@
1
+---
2
+version: '2'
3
+
4
+services:
5
+  reporter:
6
+    build: ..
7
+    image: csmith/service-reporter-lib:dev
8
+    networks: ['testing']
9
+  tests:
10
+    build: .
11
+    image: csmith/service-reporter-lib-test:dev
12
+    depends_on: ['reporter']
13
+    networks: ['testing']
14
+
15
+networks:
16
+  testing:
17
+

Loading…
Cancel
Save