GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MyJob/Makefile at main · anthrodjear/MyJob

Expand file tree

/

Makefile

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
391 lines (317 loc) · 12 KB
/

Makefile

Copy path

File metadata and controls

391 lines (317 loc) · 12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
.PHONY: help setup migrate seed start stop clean build _export-env dev-api dev-worker dev-frontend dev-browser build-api build-worker build-frontend build-browser hash-password logs logs-api logs-worker logs-browser logs-frontend shell-api shell-worker shell-browser shell-frontend shell-postgres shell-redis test test-api test-frontend lint lint-go lint-frontend lint-browser-agent verify-swagger ci-local docker-ci docker-ci-down health-check helm-lint helm-template helm-staging helm-production helm-rollback kubectl-hpa kubectl-pods kubectl-logs kustomize-build setup-production start-production stop-production build-production logs-production shell-nginx setup-ssl nginx-test health-check-production deploy-setup deploy-docker deploy-helm deploy-kustomize deploy-dry-run deploy-quick
# Default target
help:
@echo "AI Job Search Agent - Commands:"
@echo ""
@echo " Quick Start (zero-config):"
@echo " docker compose up -d # Just works — configure via /setup wizard"
@echo ""
@echo " Setup & Start (with .env):"
@echo " make setup - First-time setup (create .env, start infra, run migrations)"
@echo " make start - Start all services (auto-generates .env if missing)"
@echo " make stop - Stop all services"
@echo " make build - Build all Docker images"
@echo " make clean - Remove containers and volumes"
@echo ""
@echo " Database:"
@echo " make migrate - Run database migrations"
@echo " make seed - Seed initial data"
@echo ""
@echo " Development:"
@echo " make dev-api - Run Go API locally"
@echo " make dev-worker - Run Go Worker locally"
@echo " make dev-frontend - Run Next.js frontend locally"
@echo " make dev-browser - Run Browser Agent locally"
@echo ""
@echo " Build (local):"
@echo " make build-api - Build Go API binary"
@echo " make build-worker - Build Go Worker binary"
@echo " make build-frontend - Build Next.js frontend"
@echo " make build-browser - Build Browser Agent"
@echo ""
@echo " Logs:"
@echo " make logs - View all service logs"
@echo " make logs-api - View API logs"
@echo " make logs-worker - View Worker logs"
@echo " make logs-browser - View Browser Agent logs"
@echo " make logs-frontend - View Frontend logs"
@echo ""
@echo " Shell Access:"
@echo " make shell-api - Shell into API container"
@echo " make shell-worker - Shell into Worker container"
@echo " make shell-browser - Shell into Browser Agent container"
@echo " make shell-frontend - Shell into Frontend container"
@echo " make shell-postgres - PostgreSQL CLI"
@echo " make shell-redis - Redis CLI"
@echo ""
@echo " Testing:"
@echo " make test - Run all tests"
@echo " make test-api - Run Go API tests"
@echo " make test-frontend - Run Frontend tests"
@echo ""
@echo " Utils:"
@echo " make hash-password PASSWORD=yourpass - Generate bcrypt hash for AUTH_PASSWORD_HASH"
@echo ""
@echo " Deployment Wizard:"
@echo " make deploy-setup - Interactive deployment (Docker or K8s)"
@echo " make deploy-docker - Deploy with Docker Compose"
@echo " make deploy-helm - Deploy with Kubernetes (Helm)"
@echo " make deploy-kustomize - Deploy with Kubernetes (Kustomize)"
@echo " make deploy-dry-run - Preview deployment without executing"
@echo " make deploy-quick - Non-interactive production deploy"
# First-time setup (optional — docker compose works without it)
setup:
@bash scripts/setup-env.sh
@echo ""
@echo "Setup complete! Starting infrastructure..."
$(MAKE) _export-env
docker compose up -d postgres redis
@echo ""
@echo "Infrastructure started. Run 'make build' then 'make start'."
# Internal: export AUTH_PASSWORD_HASH from .env so docker-compose
# can pass it to containers without $-escaping issues.
_export-env:
@if [ ! -f .env ]; then bash scripts/setup-env.sh; fi
@echo "Auth hash loaded from .env"
# Run migrations
migrate:
docker compose exec api /app/scripts/migrate.sh
# Seed initial data
seed:
bash scripts/seed.sh
# Start all services (auto-generates .env if missing)
# Two-phase start: infra first, then app services (avoids dependency timeout)
start:
@if [ ! -f .env ]; then bash scripts/setup-env.sh; fi
@export AUTH_PASSWORD_HASH="$$(cat .env.auth 2>/dev/null)" && \
docker compose up -d postgres redis livekit
@echo "Waiting for infrastructure..."
@sleep 5
@export AUTH_PASSWORD_HASH="$$(cat .env.auth 2>/dev/null)" && \
docker compose up -d api
@echo "Waiting for API to become healthy..."
@timeout 120 bash -c 'until docker compose exec api wget -qO- http://localhost:8080/health >/dev/null 2>&1; do sleep 3; done'
@export AUTH_PASSWORD_HASH="$$(cat .env.auth 2>/dev/null)" && \
docker compose up -d worker browser-agent frontend
@echo "All services started."
# Stop all services
stop:
docker compose down
# Build Docker images
build:
@if [ ! -f .env ]; then bash scripts/setup-env.sh; fi
@export AUTH_PASSWORD_HASH="$$(cat .env.auth 2>/dev/null)" && \
docker compose build
# Clean everything
clean:
docker compose down -v
@echo "Removed containers and volumes"
# ============================================
# Local Development
# ============================================
# Run Go API locally
dev-api:
cd backend && go run ./cmd/api
# Run Go Worker locally
dev-worker:
cd backend && go run ./cmd/worker
# Run Next.js frontend locally
dev-frontend:
cd frontend && npm run dev
# Run Browser Agent locally
dev-browser:
cd browser-agent && npm run dev
# ============================================
# Local Builds
# ============================================
# Build Go API binary
build-api:
cd backend && go build -o ../bin/api.exe ./cmd/api
# Build Go Worker binary
build-worker:
cd backend && go build -o ../bin/worker.exe ./cmd/worker
# Build Next.js frontend
build-frontend:
cd frontend && npm run build
# Build Browser Agent
build-browser:
cd browser-agent && npm run build
# Generate bcrypt password hash for AUTH_PASSWORD_HASH
# Usage: make hash-password PASSWORD="yourpassword"
hash-password:
cd backend && go run ../scripts/hash_password.go "$(PASSWORD)"
# ============================================
# Logs
# ============================================
logs:
docker compose logs -f
logs-api:
docker compose logs -f api
logs-worker:
docker compose logs -f worker
logs-browser:
docker compose logs -f browser-agent
logs-frontend:
docker compose logs -f frontend
# ============================================
# Shell Access
# ============================================
shell-api:
docker compose exec api sh
shell-worker:
docker compose exec worker sh
shell-browser:
docker compose exec browser-agent sh
shell-frontend:
docker compose exec frontend sh
shell-postgres:
docker compose exec postgres psql -U myjob -d myjob
shell-redis:
docker compose exec redis redis-cli
# ============================================
# Testing
# ============================================
test:
cd backend && go test ./...
cd browser-agent && npm test
cd frontend && npm test
test-api:
cd backend && go test ./...
test-frontend:
cd frontend && npm test
# ============================================
# CI / Lint
# ============================================
lint: lint-go lint-frontend lint-browser-agent
lint-go:
cd backend && go vet ./...
golangci-lint run --config ../.golangci.yml ./...
lint-frontend:
cd frontend && npm run lint
cd frontend && npx tsc --noEmit
lint-browser-agent:
cd browser-agent && npx eslint src/ --max-warnings 0 || true
cd browser-agent && npx tsc --noEmit
# Verify swagger docs are up to date (regenerate and check for diff)
verify-swagger:
cd backend && go install github.com/swaggo/swag/cmd/swag@latest && \
swag init -g cmd/api/main.go --output docs && \
cd .. && git diff --exit-code backend/docs/docs.go backend/docs/swagger.json backend/docs/swagger.yaml
# Run full CI locally (lint + test + docker build)
ci-local: lint test build
# Docker compose CI mode (clean state, no host dependencies)
docker-ci:
@if [ ! -f .env ]; then bash scripts/setup-env.sh; fi
@export AUTH_PASSWORD_HASH="$$(cat .env.auth 2>/dev/null)" && \
docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d --build
docker-ci-down:
docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v
# Health check
health-check:
bash scripts/ci-health-check.sh
# ============================================
# Kubernetes / Helm
# ============================================
# Lint Helm chart
helm-lint:
helm lint k8s/helm/myjob
# Dry-run Helm template (local rendering)
helm-template:
helm template myjob k8s/helm/myjob
# Install/upgrade staging
helm-staging:
helm upgrade --install myjob-staging k8s/helm/myjob \
--namespace myjob-staging \
--create-namespace \
--values k8s/helm/myjob/values.yaml \
--set api.image.tag=$(TAG) \
--set worker.image.tag=$(TAG) \
--set browserAgent.image.tag=$(TAG) \
--set frontend.image.tag=$(TAG)
# Install/upgrade production
helm-production:
helm upgrade --install myjob-production k8s/helm/myjob \
--namespace myjob-production \
--create-namespace \
--values k8s/helm/myjob/values.yaml \
--set api.image.tag=$(TAG) \
--set worker.image.tag=$(TAG) \
--set browserAgent.image.tag=$(TAG) \
--set frontend.image.tag=$(TAG) \
--set api.replicaCount=3 \
--set worker.replicaCount=3 \
--set frontend.replicaCount=3
# Rollback Helm release
helm-rollback:
helm rollback $(RELEASE) -n $(NAMESPACE)
# Check HPA status
kubectl-hpa:
kubectl get hpa -n $(NAMESPACE)
# Check all pods
kubectl-pods:
kubectl get pods -n $(NAMESPACE) -o wide
# Tail logs
kubectl-logs:
kubectl logs -n $(NAMESPACE) -l app.kubernetes.io/name=myjob --tail=100 -f
# Kustomize build
kustomize-build:
kubectl kustomize k8s/kustomize/overlays/$(ENV)
# ============================================
# Production Deployment
# ============================================
# Full production setup (SSL + secrets + build + deploy)
setup-production:
@echo "Running production setup via deploy-setup.sh..."
bash scripts/deploy-setup.sh --method docker --profile production
# Start production (with nginx reverse proxy)
start-production:
@if [ ! -f .env ]; then cp .env.production .env 2>/dev/null || true; fi
docker compose -f docker-compose.yml -f docker-compose.production.yml up -d
@echo "Production started. Access via http://localhost or https://localhost"
# Stop production
stop-production:
docker compose -f docker-compose.yml -f docker-compose.production.yml down
# Build production images
build-production:
docker compose -f docker-compose.yml -f docker-compose.production.yml build
# Production logs
logs-production:
docker compose -f docker-compose.yml -f docker-compose.production.yml logs -f
# Production shell access
shell-nginx:
docker compose -f docker-compose.yml -f docker-compose.production.yml exec nginx sh
# SSL certificate setup
setup-ssl:
bash scripts/setup-ssl.sh
# Validate nginx config
nginx-test:
docker compose -f docker-compose.yml -f docker-compose.production.yml exec nginx nginx -t
# Production health check
health-check-production:
@echo "=== Service Health ==="
@docker compose -f docker-compose.yml -f docker-compose.production.yml ps
@echo ""
@echo "=== HTTP Health ==="
@curl -sf http://localhost/health && echo " [OK]" || echo " [FAIL]"
@curl -sf http://localhost:8080/health && echo " [OK]" || echo " [FAIL]"
# ============================================
# Interactive Deployment Setup
# ============================================
# Interactive deployment wizard (Docker or Kubernetes)
deploy-setup:
bash scripts/deploy-setup.sh
# Deploy with Docker Compose (interactive wizard)
deploy-docker:
bash scripts/deploy-setup.sh --method docker
# Deploy with Helm (interactive wizard)
deploy-helm:
bash scripts/deploy-setup.sh --method k8s-helm
# Deploy with Kustomize (interactive wizard)
deploy-kustomize:
bash scripts/deploy-setup.sh --method k8s-kustomize
# Dry-run deployment setup (preview without deploying)
deploy-dry-run:
bash scripts/deploy-setup.sh --dry-run
# Quick production deploy (non-interactive, uses defaults)
deploy-quick:
bash scripts/deploy-setup.sh --non-interactive --method docker --profile production
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.