-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (70 loc) · 2.13 KB
/
Makefile
File metadata and controls
81 lines (70 loc) · 2.13 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
.PHONY: help init plan apply destroy setup status logs clean generate migrate-state
# Default target
help:
@echo "OpenClaw Kubernetes Deployment"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Terraform Commands:"
@echo " init Initialize Terraform"
@echo " plan Preview Terraform changes"
@echo " apply Deploy with Terraform"
@echo " destroy Destroy all resources"
@echo " migrate-state Migrate state from old (flat) structure"
@echo ""
@echo "Script Commands:"
@echo " setup Run interactive setup script"
@echo " status Show deployment status"
@echo " logs Follow gateway logs"
@echo ""
@echo "Utility Commands:"
@echo " generate Generate bundled manifest"
@echo " clean Remove generated files"
# Terraform commands (run from terraform/ directory)
init:
cd terraform && terraform init
plan:
cd terraform && terraform plan
apply:
cd terraform && terraform apply
destroy:
cd terraform && terraform destroy
# Script wrappers
setup:
./scripts/setup.sh
status:
./scripts/tools.sh status
logs:
./scripts/tools.sh logs
generate:
./scripts/generate-manifest.sh
clean:
rm -f manifests/bundled/openclaw-k8s.yaml
# Migrate state from old (flat) structure to new terraform/ directory
migrate-state:
@echo "==> Migrating Terraform state from old structure..."
@if [ -f "terraform.tfstate" ]; then \
echo " Moving terraform.tfstate..."; \
mv terraform.tfstate terraform/; \
fi
@if [ -f "terraform.tfstate.backup" ]; then \
echo " Moving terraform.tfstate.backup..."; \
mv terraform.tfstate.backup terraform/; \
fi
@if [ -d ".terraform" ]; then \
echo " Moving .terraform/..."; \
mv .terraform terraform/; \
fi
@if [ -f ".terraform.lock.hcl" ]; then \
echo " Moving .terraform.lock.hcl..."; \
mv .terraform.lock.hcl terraform/; \
fi
@if [ -f "terraform.tfvars" ]; then \
echo " Moving terraform.tfvars..."; \
mv terraform.tfvars terraform/; \
fi
@echo "==> Running terraform init..."
cd terraform && terraform init
@echo ""
@echo "==> Migration complete! Verify with:"
@echo " cd terraform && terraform plan"