-
Notifications
You must be signed in to change notification settings - Fork 94
/
.gitlab-ci.yml
39 lines (36 loc) · 955 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Use a fixed version as latest tag doesn't exist
# https://hub.docker.com/r/docker/compose/tags
image:
name: docker/compose:1.24.1
entrypoint: ["sh", "-c"]
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
Build and Test:
before_script:
- apk add --update curl
- docker version
- docker-compose version
script:
- docker-compose build
- docker-compose up --detach
- until [ $(docker-compose logs app | grep -c "Running on ") -eq 1 ];
do
sleep 2;
done
- until [ $(docker-compose logs db | grep -c "ready for connections") -eq 2 ];
do
sleep 2;
done
- >
echo -n '{"favorite_colors": [{"Lancelot": "blue"}, {"Galahad":
"yellow"}]}' > expected
- curl -f http://docker:5000 > output
- diff expected output
- touch success
after_script:
- if [ ! -e success ]; then
docker-compose logs;
fi