-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
149 lines (125 loc) · 3.86 KB
/
Copy pathTaskfile.yml
File metadata and controls
149 lines (125 loc) · 3.86 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
version: '3'
vars:
APP_DIR: ./app
WEB_DIR: ./web
LAMBDA_DIR: ./modules/workloads/ci_lambda
tasks:
# ─── Development ────────────────────────────────────────
tui:
desc: "Run the TUI app (usage: task tui -- path/to/project)"
deps: [build]
cmd: cd {{.CLI_ARGS | default "."}} && {{.ROOT_DIR}}/meroku
vars:
ROOT_DIR:
sh: pwd
web:
desc: Run the web frontend dev server
dir: '{{.WEB_DIR}}'
cmd: bun dev
build:
desc: Build the CLI binary
dir: '{{.APP_DIR}}'
cmd: go build -o ../meroku .
test:
desc: Run Go tests
dir: '{{.APP_DIR}}'
cmd: go test ./...
test:web:
desc: Run web frontend tests
dir: '{{.WEB_DIR}}'
cmd: bun test
generate:
desc: Generate code from templates
dir: '{{.APP_DIR}}'
cmd: go generate ./...
lint:web:
desc: Lint web frontend
dir: '{{.WEB_DIR}}'
cmd: bunx biome check .
# ─── Web Build ──────────────────────────────────────────
web:build:
desc: Build web frontend into app/webapp (embedded in Go binary)
dir: '{{.WEB_DIR}}'
cmd: bun run build
# ─── Infrastructure (run from a project directory) ──────
infra-gen-dev:
desc: Generate Terraform files for dev environment
dir: '{{.APP_DIR}}'
cmd: go run . template -c vars=dev.yaml -f ./infrastructure/env/main.hbs -o ./env/dev/main.tf
infra-gen-prod:
desc: Generate Terraform files for prod environment
dir: '{{.APP_DIR}}'
cmd: go run . template -c vars=prod.yaml -f ./infrastructure/env/main.hbs -o ./env/prod/main.tf
infra-init:
desc: Initialize Terraform
dir: project/env/{{.env}}
cmd: terraform init
requires:
vars: [env]
infra-plan:
desc: Plan infrastructure changes
dir: project/env/{{.env}}
cmd: terraform plan
requires:
vars: [env]
infra-apply:
desc: Apply infrastructure changes
dir: project/env/{{.env}}
cmd: terraform apply
requires:
vars: [env]
infra-destroy:
desc: Destroy infrastructure
dir: project/env/{{.env}}
cmd: terraform destroy
requires:
vars: [env]
infra-show:
desc: Show current infrastructure state
dir: project/env/{{.env}}
cmd: terraform show
requires:
vars: [env]
infra-update:
desc: Update Terraform modules
dir: project
cmd: |
rm -rf ./infrastructure
git clone --depth=1 --branch=main https://github.com/MadAppGang/infrastructure.git ./infrastructure
rm -rf ./infrastructure/.git
requires:
vars: [env]
infra-import:
desc: Import existing AWS resources
dir: project/env/{{.env}}
cmd: terraform import
requires:
vars: [env]
# ─── CI Lambda ──────────────────────────────────────────
lambda:build:
desc: Build CI/CD Lambda function
dir: '{{.LAMBDA_DIR}}'
cmd: GOOS=linux GOARCH=amd64 go build -o bootstrap main.go
lambda:test:
desc: Run Lambda unit tests
dir: '{{.LAMBDA_DIR}}'
cmd: go test -v ./...
lambda:package:
desc: Build and package Lambda for deployment
dir: '{{.LAMBDA_DIR}}'
deps: [lambda:build]
cmd: zip ci_lambda.zip bootstrap
lambda:clean:
desc: Clean Lambda build artifacts
dir: '{{.LAMBDA_DIR}}'
cmd: rm -f bootstrap integration_test ci_lambda.zip
# ─── Release ────────────────────────────────────────────
version:
desc: Show current version
cmd: cat ./version.txt
renderdiff:
desc: Test terraform plan diff viewer
dir: '{{.APP_DIR}}'
cmd: go run . --renderdiff {{.file}}
requires:
vars: [file]