-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
31 lines (28 loc) · 973 Bytes
/
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
# File: Makefile
# Version: GNU Make 3.81
# Author: Nicholas Russo (njrusmc@gmail.com)
# Purpose: Phony targets used for linting (YAML/Python) and running
# the script for some quick testing. The 'test' target runs
# the lint, unit testing, and playbook testing in series.
# Individual targets can be run as well, typically for CI.
# See .travis.yml for the individual target invocations.
.PHONY: test
test: lint unit pb
.PHONY: lint
lint:
@echo "Starting lint"
find . -name "*.yml" | xargs yamllint -s
find . -name "*.py" | xargs pylint
find . -name "*.py" | xargs black -l 80 --check
find . -name "*.py" | xargs bandit
@echo "Completed lint"
.PHONY: unit
unit:
@echo "Starting unit tests"
ansible-playbook tests/unittest_playbook.yml
@echo "Completed unit tests"
.PHONY: pb
pb:
@echo "Starting playbook tests"
ansible-playbook tests/test_playbook.yml --skip-tags "do_ssh" -l csr1
@echo "Completed playbook tests"