forked from roots/trellis
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.yml
80 lines (76 loc) · 2.53 KB
/
config.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
version: 2.1
orbs:
trellis:
executors:
python-2:
docker:
- image: 'circleci/python:2-stretch'
python-3:
docker:
- image: 'circleci/python:3-stretch'
jobs:
syntax-check:
parameters:
ansible-version:
type: string
python-version:
type: enum
enum: ['3', '2']
executor: python-<< parameters.python-version >>
steps:
- run: python --version
- checkout
- restore_cache:
keys:
- ansible-v1-<< parameters.python-version >>-<< parameters.ansible-version >>-{{ checksum "galaxy.yml" }}
- run:
name: Install Python dependencies in a venv
command: |
virtualenv venv
. venv/bin/activate
pip install ansible<< parameters.ansible-version >>
ansible --version
- run:
name: Install Galaxy roles
command: |
. venv/bin/activate
ansible-galaxy install -r galaxy.yml
- save_cache:
key: ansible-v1-<< parameters.python-version >>-<< parameters.ansible-version >>-{{ checksum "galaxy.yml" }}
paths:
- venv
- vendor
- run:
name: Check Playbook syntax
command: |
. venv/bin/activate
ansible-playbook --syntax-check -e env=development deploy.yml
ansible-playbook --syntax-check -e env=development dev.yml
ansible-playbook --syntax-check -e env=development server.yml
workflows:
syntax-check:
jobs:
- trellis/syntax-check:
name: syntax-check-python-3-ansible-latest
python-version: '3'
ansible-version: ''
- trellis/syntax-check:
name: syntax-check-python-3-ansible-2.8
python-version: '3'
ansible-version: ~=2.8.0
- trellis/syntax-check:
name: syntax-check-python-3-ansible-2.7
python-version: '3'
ansible-version: ~=2.7.0
- trellis/syntax-check:
name: syntax-check-python-2-ansible-latest
python-version: '2'
ansible-version: ''
- trellis/syntax-check:
name: syntax-check-python-2-ansible-2.8
python-version: '2'
ansible-version: ~=2.8.0
- trellis/syntax-check:
name: syntax-check-python-2-ansible-2.7
python-version: '2'
ansible-version: ~=2.7.0