-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (60 loc) · 1.83 KB
/
Makefile
File metadata and controls
73 lines (60 loc) · 1.83 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
.PHONY: build clean deploy test help
# Build for AWS Lambda (ARM64)
build-aws:
@echo "Building AWS Lambda handler..."
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -tags lambda.norpc -o bootstrap main.go
@echo "Build complete: bootstrap"
# Build for Azure Functions
build-azure:
@echo "Building Azure Functions handler..."
cd src/handlers/azure && GOOS=linux GOARCH=amd64 go build -o handler main.go
@echo "Build complete: src/handlers/azure/handler"
# Build for GCP Cloud Functions
build-gcp:
@echo "Building GCP Cloud Functions handler..."
cd src/handlers/gcp && GOOS=linux GOARCH=amd64 go build -o function main.go
@echo "Build complete: src/handlers/gcp/function"
# Build all handlers
build: build-aws build-azure build-gcp
# Clean build artifacts
clean:
rm -f bootstrap
rm -f src/handlers/azure/handler
rm -f src/handlers/gcp/function
# Download dependencies
deps:
go mod download
go mod tidy
# Run tests
test:
go test -v ./...
# Deploy to AWS using SAM
deploy-aws: build-aws
@echo "Deploying to AWS..."
cd database/aws && sam deploy --guided
# Package for AWS
package-aws: build-aws
cd database/aws && sam build
# Local AWS testing with SAM
local-aws: build-aws
cd database/aws && sam local start-api
# Format code
fmt:
go fmt ./...
# Run linter
lint:
golangci-lint run ./...
# Help
help:
@echo "Available targets:"
@echo " build-aws - Build AWS Lambda handler"
@echo " build-azure - Build Azure Functions handler"
@echo " build-gcp - Build GCP Cloud Functions handler"
@echo " build - Build all handlers"
@echo " clean - Remove build artifacts"
@echo " deps - Download dependencies"
@echo " test - Run tests"
@echo " deploy-aws - Deploy to AWS using SAM"
@echo " local-aws - Run locally with SAM"
@echo " fmt - Format code"
@echo " lint - Run linter"