-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (52 loc) · 1.9 KB
/
Copy pathMakefile
File metadata and controls
65 lines (52 loc) · 1.9 KB
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
TOX=tox
export TOX
include Makefiles/molecule/Makefile
include Makefiles/run.Makefile
include Makefiles/spelling.Makefile
include Makefiles/build.Makefile
.ONESHELL:
.tox/%/ansible_collections: venv/bin/activate
. venv/bin/activate
$(TOX) exec -e $* -- ansible-galaxy collection install -r requirements.yml
$(TOX) exec -e $* -- ansible-galaxy collection install -r tox/requirements-$*.yml
.PHONY: lint/ansible_collections
.ONESHELL:
lint/ansible_collections: venv/bin/activate
. venv/bin/activate
$(TOX) exec -e lint -- ansible-galaxy collection install -r tox/requirements-molecule.yml
.ONESHELL:
venv/bin/activate: ## Create virtual environment
python3 -m venv venv
. venv/bin/activate && pip install -r requirements.txt
. venv/bin/activate && pip install -r requirements-dev.txt
.PHONY: ansible-lint
.ONESHELL:
ansible-lint: venv/bin/activate .tox/lint/ansible_collections lint/ansible_collections ## Run ansible-lint
. venv/bin/activate
$(TOX) exec -e lint -- ansible-lint --offline --config .config/ansible-lint.yml
.PHONY: yamllint
.ONESHELL:
yamllint: venv/bin/activate ## Run yamllint
. venv/bin/activate
$(TOX) exec -e lint -- yamllint . --config-file .config/yamllint.yml
.PHONY: lint
lint: cspell collection-dependencies ansible-lint yamllint ## Run all linting for the project
.PHONY: clean-venv
clean-venv: ## Clean virtual environment
rm -rf venv
.PHONY: clean-tox
clean-tox: ## Clean virtual environment
rm -rf .tox
.PHONY: clean-tox-%
clean-tox-%: ## Clean virtual environment
rm -rf .tox/$*
.PHONY: clean
clean: clean-venv clean-tox ## Clean
.PHONY: collection-list-%
.ONESHELL:
collection-list-%: venv/bin/activate ## List ansible installed collections
. venv/bin/activate
$(TOX) exec -e $* -- ansible-galaxy collection list
.PHONY: collection-dependencies
collection-dependencies: ## Check if collection dependencies and project requirements are the same
./hack/collection-dependencies.sh