-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose-test.yml
57 lines (57 loc) · 1.29 KB
/
docker-compose-test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
# This compose file shows how to implement a simple
# pipeline execution based on different docker containers
# via the depends_on keyword.
# The checkout service clones a repository
# The zero service runs pre-commit
# The one service runs tests and so on.
version: '3.9'
services:
checkout: &baseline
image: alpine/git
volumes:
- ./deleteme:/code:z
working_dir: /code
entrypoint: ["sh"]
command: |-
-c '
(test -d /code/.git
# && git -C /code pull --rebase
) ||
git clone https://github.com/teamdigitale/json-semantic-playground.git /code
'
zero:
build:
context: ./
dockerfile: Dockerfile.precommit
volumes:
- ./deleteme:/code
working_dir: /code
entrypoint: ['pre-commit']
command: ['run', '-a']
depends_on:
checkout:
condition: service_completed_successfully
one:
<<: *baseline
build:
context: ./
dockerfile: Dockerfile.tox
entrypoint: ["tox"]
command: ["-e", "py3"]
depends_on:
- zero
two:
<<: *baseline
image: busybox
entrypoint: ["busybox"]
command: ['sh', '-c', 'exit 0']
depends_on:
- one
three:
<<: *baseline
image: busybox
entrypoint: ["busybox"]
command: ['sh', '-c', 'exit 0']
depends_on:
- two