feat: help annotations for Makefile

This commit is contained in:
Aravinth Manivannan 2023-07-16 19:53:39 +05:30
parent a3c30cc5cb
commit 78dd6c7c61
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88

View file

@ -53,29 +53,29 @@ define test_loadbalance
endef
configure:
configure: ## Configure whole deployment
$(call configure_ping)
$(call configure_base)
$(call configure_libreddit)
$(call configure_loadbalance)
configure.ping:
configure.ping: ## Ping all VMs
$(call configure_ping)
configure.base:
configure.base: ## Configure all VMs to base production configuration
$(call configure_ping)
$(call configure_base)
configure.libreddit:
configure.libreddit: ## Configure libreddit
$(call configure_ping)
$(call configure_libreddit)
configure.loadbalance:
configure.loadbalance: ## Configure loadbalancer
$(call configure_ping)
$(call configure_loadbalance)
lint:
lint: ## Lint source code
terraform fmt
ansible-lint --write ./ansible/playbook.yml
ansible-lint --write ./ansible/shutdown.yml
@ -83,23 +83,27 @@ lint:
ansible-lint --write ./ansible/libreddit.yml
. ./venv/bin/activate && black tests/
on:
on: ## Boot VMs
./scripts/on.sh
virsh list
shutdown:
shutdown: ## Shutdown VMs
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/shutdown.yml
test:
test: ## Run all tests
$(call test_base)
$(call test_loadbalance)
$(call test_libreddit)
test.base:
test.base: ## Test base configuration on all VMs
$(call test_base)
test.loadbalance:
test.loadbalance: ## Test loadbalancer installation
$(call test_loadbalance)
test.libreddit:
test.libreddit: ## Test libreddit installation
$(call test_libreddit)
help: ## Prints help for targets with comments
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-].+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'