-
Notifications
You must be signed in to change notification settings - Fork 12
/
circleci-config.yml
103 lines (98 loc) · 2.32 KB
/
circleci-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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
version: 2.1
executors:
python:
docker:
- image: cimg/python:3.10
python_large:
docker:
- image: cimg/python:3.9
resource_class: large
publisher:
docker:
- image: quay.io/cloudalchemy/publisher:latest
jobs:
lint:
executor: python
steps:
- checkout
- run: pip install ansible ansible-lint yamllint flake8
- run: ansible-lint .
- run: yamllint .
- run: flake8
test:
executor: python_large
parameters:
ansible:
type: string
scenario:
type: string
steps:
- checkout
- setup_remote_docker
- run: pip install "ansible~=<< parameters.ansible >>.0"
- run: pip install -r test-requirements.txt
- run:
no_output_timeout: 60m
command: |
if [[ -n "${CIRCLE_PULL_REQUEST}" ]] && [[ '<< parameters.scenario >>' == 'latest' ]]; then
echo 'Not running latest on PR'
else
molecule test -s '<< parameters.scenario >>' --destroy always
fi
release:
executor: publisher
steps:
- checkout
- run: |
PROJECT_USERNAME="${CIRCLE_PROJECT_USERNAME}" \
PROJECT_REPONAME="${CIRCLE_PROJECT_REPONAME}" \
create_release
galaxy:
executor: python
steps:
- checkout
- run: pip install ansible
- run: ansible-galaxy role import --token "${GALAXY_TOKEN}" "${CIRCLE_PROJECT_USERNAME}" "${CIRCLE_PROJECT_REPONAME}"
workflows:
version: 2
molecule:
jobs:
- lint:
filters:
tags:
only: /.*/
- test:
matrix:
parameters:
ansible:
- "2.9"
- "2.10"
- "4.10"
- "5.1"
scenario:
- default
- alternative
- latest
filters:
tags:
only: /.*/
- release:
context: release
requires:
- lint
- test
filters:
branches:
only: master
tags:
ignore: /.*/
- galaxy:
context: galaxy
requires:
- lint
- test
- release
filters:
branches:
only: master