-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
48 lines (40 loc) · 1.16 KB
/
Makefile
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
.PHONY: dependencies clean lint fmt syntax-check
all: dependencies
# clean removes and re-initializes the directories that have their contents
# ignored by git. This will force a re-installation of the requirements, roles,
# etc.
clean:
rm -rf my-logs
mkdir my-logs
touch my-logs/.empty-file
rm -rf ansible_collections
rm -rf roles
dependencies:
pip install yamllint
pip3 install "ansible-lint"
# yamlfix is a helper tool that will fix common yaml errors. If we can enable it
# that would help ensure code standards but we need tests first to ensure the
# updates don't break things. Until then we need to address the lint errors
# manually.
#
# https://lyz-code.github.io/yamlfix/
# pip install yamlfix
#fmt:
# yamlfix .
# https://ansible-lint.readthedocs.io/
ansible-lint:
ansible-lint -p
# https://yamllint.readthedocs.io/
yamllint:
yamllint --no-warnings .
# syntax-check statically checks the syntax for all the playbooks in playbooks
# directory
syntax-check:
for f in $$(ls ./playbooks); do \
if ! [ -d ./playbooks/$$f ]; \
then \
./scripts/syntax-check.sh ./playbooks/$$f || exit 1; \
fi \
done
# run all linters
lint: yamllint syntax-check ansible-lint