-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.gitlab-ci.yml
69 lines (60 loc) · 1.38 KB
/
.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
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
stages:
- test
variables:
roles_path: /etc/ansible/roles/tests
.test: &test
image: docker:stable
services:
- docker:dind
stage: test
before_script:
- docker pull ${distribution}:${version}
- docker build --no-cache --rm
--build-arg version=${version}
-f tests/${distribution}.dockerfile
--tag=${distribution}-${version}:ansible tests
- export container_id=$(mktemp)
- docker run --detach -v $PWD/tests:${roles_path}:ro ${distribution}-${version}:ansible > "${container_id}"
script:
- docker exec "$(cat ${container_id})"
env ANSIBLE_FORCE_COLOR=1
ansible-playbook -v ${roles_path}/test.yml --syntax-check
- docker exec "$(cat ${container_id})"
env ANSIBLE_FORCE_COLOR=1
ansible-playbook -v ${roles_path}/test.yml
- docker rm -f "$(cat ${container_id})"
debian-buster:
<<: *test
variables:
distribution: debian
version: buster
debian-jessie:
<<: *test
variables:
distribution: debian
version: jessie
debian-stretch:
<<: *test
variables:
distribution: debian
version: stretch
ubuntu-disco:
<<: *test
variables:
distribution: ubuntu
version: disco
ubuntu-cosmic:
<<: *test
variables:
distribution: ubuntu
version: cosmic
ubuntu-bionic:
<<: *test
variables:
distribution: ubuntu
version: bionic
ubuntu-xenial:
<<: *test
variables:
distribution: ubuntu
version: xenial