-
Notifications
You must be signed in to change notification settings - Fork 104
/
pipe.yml
92 lines (82 loc) · 2.63 KB
/
pipe.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
resources:
- name: code
type: git
source:
uri: https://github.com/meAmidos/dcind
- name: redis
type: docker-image
source:
repository: redis
tag: alpine
- name: busybox
type: docker-image
source:
repository: busybox
jobs:
- name: unit-tests
plan:
- get: code
params: {depth: 1}
- task: Run unit tests
config:
platform: linux
image_resource:
type: docker-image
source:
repository: busybox
inputs:
- name: code
run:
path: sh
args:
- -exc
- |
./code/example/unit-tests.sh
- name: integration
plan:
- aggregate:
- get: code
params: {depth: 1}
passed: [unit-tests]
trigger: true
- get: redis
params: {save: true}
- get: busybox
params: {save: true}
- task: Run integration tests
privileged: true
config:
platform: linux
image_resource:
type: docker-image
source:
repository: amidos/dcind
inputs:
- name: code
- name: redis
- name: busybox
run:
path: bash
args:
- -exc
- |
source /docker-lib.sh
start_docker
# Strictly speaking, preloading of Docker images is not required.
# However, you might want to do this for a couple of reasons:
# - If the image comes from a private repository, it is much easier to let Concourse pull it,
# and then pass it through to the task.
# - When the image is passed to the task, Concourse can often get the image from its cache.
docker load -i redis/image
docker tag "$(cat redis/image-id)" "$(cat redis/repository):$(cat redis/tag)"
docker load -i busybox/image
docker tag "$(cat busybox/image-id)" "$(cat busybox/repository):$(cat busybox/tag)"
# This is just to visually check in the log that images have been loaded successfully.
docker images
# Run the container with tests and its dependencies.
docker-compose -f code/example/integration.yml run tests
# Cleanup.
# Not sure if this is required.
# It's quite possible that Concourse is smart enough to clean up the Docker mess itself.
docker volume rm $(docker volume ls -q)