Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
109 lines (91 loc) · 3.35 KB
/
Copy pathMakefile
File metadata and controls
109 lines (91 loc) · 3.35 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Makefile for Terraform scripts
# Terraform working directory
TF_DIR := terraform/base
# Terraform variables file (relative to TF_DIR)
TFVARS ?= ../../terraform.tfvars
setup: # Setup's local machine
brew install terraform
brew install tflint
brew install jq
brew install ansible
git submodule update --init --recursive
.PHONY: setup
fmt: # Format Terraform files
terraform fmt -recursive
.PHONY: fmt
lint: # Lint Terraform files
tflint
.PHONY: lint
init: # Initialize Terraform with B2 backend
terraform -chdir=$(TF_DIR) init -upgrade \
-backend-config="access_key=${BACK_BLAZE_KEY_ID}" \
-backend-config="secret_key=${BACK_BLAZE_APPLICATION_KEY}"
.PHONY: init
init-vendor: # Initialize Git submodules (WebKit roles)
git submodule update --init --recursive
@echo "WebKit submodule initialized successfully"
.PHONY: init-vendor
update-roles: # Update WebKit Ansible roles to latest
git submodule update --remote vendor/webkit
@echo "WebKit roles updated to latest version"
.PHONY: update-roles
sync-actions: # Sync GitHub Actions from WebKit submodule
@echo "Syncing GitHub Actions from vendor/webkit..."
@mkdir -p .github/actions
@rm -rf .github/actions/pr-comment .github/actions/slack-notify
@cp -r vendor/webkit/internal/templates/.github/actions/pr-comment .github/actions/
@cp -r vendor/webkit/internal/templates/.github/actions/slack-notify .github/actions/
@echo "✓ Actions synced successfully"
@echo " - pr-comment: .github/actions/pr-comment/"
@echo " - slack-notify: .github/actions/slack-notify/"
@echo ""
@echo "Run this command after updating the webkit submodule to get the latest action improvements."
.PHONY: sync-actions
plan: # Run Terraform plan
terraform -chdir=$(TF_DIR) plan -var-file=$(TFVARS)
.PHONY: plan
apply: # Apply Terraform changes
terraform -chdir=$(TF_DIR) apply -var-file=$(TFVARS)
.PHONY: apply
destroy: # Destroy Terraform infrastructure
terraform -chdir=$(TF_DIR) destroy -var-file=$(TFVARS)
.PHONY: destroy
temp: # Apply Terraform changes
terraform -chdir=$(TF_DIR) state list -var-file=$(TFVARS)
.PHONY: temp
output: # Show Terraform outputs
terraform -chdir=$(TF_DIR) output
.PHONY: output
ssh-key-peekaping: # Save Peekaping SSH private key to file
terraform -chdir=$(TF_DIR) output -raw module.peekaping.ssh_private_key > peekaping-key.pem
chmod 600 peekaping-key.pem
@echo "SSH key saved to peekaping-key.pem"
.PHONY: ssh-key-peekaping
deploy-peekaping: init-vendor # Deploy or update Peekaping using Ansible
@echo "Deploying Peekaping..."
@if [ ! -f ansible/inventory-peekaping.ini ]; then \
echo "Error: Ansible inventory file not found. Run 'make apply' first to generate it."; \
exit 1; \
fi
cd ansible && ansible-playbook -i inventory-peekaping.ini playbooks/peekaping.yaml
.PHONY: deploy-peekaping
todo: # Show to-do items per file
$(Q) grep \
--exclude=Makefile.util \
--exclude-dir=vendor \
--exclude-dir=.vercel \
--exclude-dir=.gen \
--exclude-dir=.idea \
--exclude-dir=public \
--exclude-dir=node_modules \
--exclude-dir=archetypes \
--exclude-dir=.git \
--text \
--color \
-nRo \
-E '\S*[^\.]TODO.*' \
.
.PHONY: todo
help: # Display this help
$(Q) awk 'BEGIN {FS = ":.*#"; printf "Usage: make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?#/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: help