Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (42 loc) · 1.94 KB
/
Copy pathMakefile
File metadata and controls
60 lines (42 loc) · 1.94 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
.PHONY: help up down destroy status ssh provision lint syntax ping deploy deploy-check clean
# Default target when running just 'make'
.DEFAULT_GOAL := help
## ----------------------------------------------------------------------
## VAGRANT COMMANDS
## ----------------------------------------------------------------------
up: ## Start and provision the Vagrant VM
vagrant up
down: ## Stop (halt) the Vagrant VM
vagrant halt
destroy: ## Destroy the Vagrant VM (forces wipe)
vagrant destroy -f
status: ## Check the status of the Vagrant VM
vagrant status
ssh: ## SSH directly into the Vagrant VM
vagrant ssh
provision: ## Run Vagrant provisioner (re-runs Ansible via Vagrant)
vagrant provision
## ----------------------------------------------------------------------
## ANSIBLE COMMANDS
## ----------------------------------------------------------------------
ping: ## Ping all hosts in the inventory to verify connection
cd ansible && ansible all -m ping
syntax: ## Check Ansible playbooks for syntax errors
cd ansible && ansible-playbook site.yml --syntax-check
lint: ## Run ansible-lint to check best practices (requires ansible-lint)
cd ansible && ansible-lint site.yml
deploy: ## Run the main Ansible playbook
cd ansible && ansible-playbook site.yml
deploy-check: ## Dry-run the main Ansible playbook (check mode)
cd ansible && ansible-playbook site.yml --check --diff
vault-encrypt: ## Encrypt gitlab vault file
cd ansible && ansible-vault encrypt roles/gitlab/vars/vault.yml
vault-decrypt: ## Decrypt gitlab vault file
cd ansible && ansible-vault decrypt roles/gitlab/vars/vault.yml
## ----------------------------------------------------------------------
## HELP
## ----------------------------------------------------------------------
help: ## Show available commands
@echo "Usage: make [target]"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'