-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (48 loc) · 1.99 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
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/make -f
SHELL := bash
.SHELLFLAGS := -euo pipefail -c
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
COLUMNS ?= `tput cols`
CORES ?= $(shell (nproc || sysctl -n hw.ncpu) 2> /dev/null)
MAKE_CMD := ${MAKE} --jobs ${CORES} -k --no-print-directory
##@ [Manual]
.DEFAULT_GOAL := help
help: ## Display this help
@echo " __ ____ _ ";
@echo " / /__| __ )(_)_ __ ";
@echo " / / __| _ \| | '_ \ ";
@echo " / /\__ \ |_) | | | | |";
@echo "/_/ |___/____/|_|_| |_|/mega_update";
@echo "";
@echo "";
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' ${MAKEFILE_LIST}
TAGS ?= all
##@ [App]
.PHONY: dry-run
dry-run: ## Run Mega Update locally (Dry-Run mode, don't make any changes)
ansible-playbook --inventory tests/inventory --ask-become-pass tests/test.yml --check
.PHONY: run
run: ## Run Mega Update locally
ansible-playbook --inventory tests/inventory --ask-become-pass tests/test.yml --tags ${TAGS}
.PHONY: list-tasks
list-tasks: ## List supported tasks and their tags
ansible-playbook --inventory tests/inventory tests/test.yml --list-tasks
.PHONY: list-tags
list-tags: ## List all supported tags
ansible-playbook --inventory tests/inventory tests/test.yml --list-tags
##@ [Contribution]
.PHONY: lint
lint: ## Lint the project
-ansible-playbook --inventory tests/inventory tests/test.yml --syntax-check
-ansible-lint
.PHONY: ansible-facts
ansible-facts: ## Print Ansible Facts
ansible localhost --module-name ansible.builtin.setup
.PHONY: debug-run
debug-run: ## Run Mega Update locally (Debug mode, will make changes!)
ANSIBLE_ENABLE_TASK_DEBUGGER=True \
ansible-playbook --inventory tests/inventory --ask-become-pass tests/test.yml --tags ${TAGS},debug --diff --verbose
.PHONY: galaxy-Update
galaxy-update: ## Update role on Ansible Galaxy
ansible-galaxy role import slashsbin mega_update