-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (36 loc) · 1.36 KB
/
Makefile
File metadata and controls
45 lines (36 loc) · 1.36 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
SHELL := /bin/bash
########################################################################################################################
##
## Makefile for managing ansible commands
##
########################################################################################################################
list:
@grep '^[^#[:space:]].*:' Makefile
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
ansible-lint:
@# Only swallow checking errors (rc=2), not other problems (rc=1)
poetry run ansible-lint -c ansible-lint.yml -p ansible/*.yml || test $$? -eq 2
lint:
poetry run flake8 **/*.py
install:
poetry install
#########################################################################################################################
###
### Generic sub command running
###
#########################################################################################################################
first_target := $(firstword $(MAKECMDGOALS))
cmd_targets := ansible
run_targets := run run-tag run-host
ifneq ($(filter $(first_target),$(cmd_targets)),)
cmd := $(wordlist 2, $(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(cmd):;@true)
endif
ansible: guard-cmd
@account=$(account) poetry run make --no-print-directory -C ansible $(cmd)
remove-stale-locks:
@poetry run python ./scripts/terraform_force_unlock.py