-
-
Notifications
You must be signed in to change notification settings - Fork 580
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (73 loc) · 3 KB
/
Makefile
File metadata and controls
86 lines (73 loc) · 3 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.PHONY: all SHELL
# Makefile global config
.DEFAULT_GOAL:=help
.EXPORT_ALL_VARIABLES:
.ONESHELL:
.SILENT:
MAKEFLAGS += "-j$(NUM_CORES) -l$(NUM_CORES)"
MAKEFLAGS += --silent
SHELL:=/bin/bash
.SHELLFLAGS = -eu -o pipefail -c
# Makefile colors config
bold:=$(shell tput bold)
normal:=$(shell tput sgr0)
errorTitle:=$(shell tput setab 1 && tput bold && echo '\n')
recommendation:=$(shell tput setab 4)
underline:=$(shell tput smul)
reset:=$(shell tput -Txterm sgr0)
black:=$(shell tput setaf 0)
red:=$(shell tput setaf 1)
green:=$(shell tput setaf 2)
yellow:=$(shell tput setaf 3)
blue:=$(shell tput setaf 4)
magenta:=$(shell tput setaf 5)
cyan:=$(shell tput setaf 6)
white:=$(shell tput setaf 7)
define HEADER
How to use me:
make && make bootstrap
make ${cyan}<target>${reset}
endef
export HEADER
python_launcher := python$(shell cat .config/python_version.config | cut -d '=' -f 2)
-include $(addsuffix /*.mak, $(shell find .config/make -type d))
## —— Bootstrap ——————————————————————————————————————————————————————————————————————————————————
.PHONY: bootstrap
bootstrap: ## Bootstrap Ansible collection
$(MAKE) python-bootstrap
.PHONY: bootstrap-dev
bootstrap-dev: ## Bootstrap Ansible collection for development
$(MAKE) bootstrap
$(MAKE) python-bootstrap-dev
## —— Virtualenv —————————————————————————————————————————————————————————————————————————————————
.PHONY: reinitialization
reinitialization: ## Return to initial state of Bootstrap Ansible collection
$(MAKE) clean
$(MAKE) bootstrap
.PHONY: reinitialization-dev
reinitialization-dev: ## Return to initial state of Bootstrap Ansible collection for development
$(MAKE) reinitialization
$(MAKE) bootstrap-dev
## —— Tests ——————————————————————————————————————————————————————————————————————————————————————
.PHONY: tests
tests: ## tests Ansible
$(MAKE) docker-tests
$(MAKE) lint
$(MAKE) molecule-test-all
.PHONY: tests-fast
tests-fast: ## tests Ansible quickly
$(MAKE) lint
$(MAKE) molecule-converge
## —— Clean ——————————————————————————————————————————————————————————————————————————————————————
.PHONY: clean
$(MAKE) clean
clean: ## Clean
rm -rf .venv/
rm -rf vendor/
rm -f *.mak
rm -rf .pytest_cache/
rm -rf scripts/.pytest_cache/
rm -rf scripts/tests/__pycache__/
rm -rf scripts/modules/__pycache__/
rm -rf scripts/modules/services/__pycache__/
rm -rf scripts/modules/utils/__pycache__/