-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (51 loc) · 1.42 KB
/
Makefile
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
.PHONY: sqlc-generate
sqlc-generate:
docker run --rm -v `pwd`:/src -w /src kjconroy/sqlc generate
.PHONY: lint
lint:
docker run --rm -v `pwd`:/app -w /app golangci/golangci-lint:v1.50.1 golangci-lint run -v
.PHONY: format
format:
docker run --rm -v `pwd`:/app -w /app golangci/golangci-lint:v1.50.1 golangci-lint run -v --fix
.PHONY: run-normal-build
run-normal-build:
AIR_CONF=air.normal.toml docker compose up dev nginx --build -d
.PHONY: run-normal
run-normal:
AIR_CONF=air.normal.toml docker compose up dev nginx -d
.PHONY: run-debug-build
run-debug-build:
AIR_CONF=air.debug.toml docker compose up dev nginx --build -d
.PHONY: run-debug
run-debug:
AIR_CONF=air.debug.toml docker compose up dev nginx -d
.PHONY: test-build
test-build:
docker compose up test --build
.PHONY: test
test:
docker compose up test
.PHONY: deps
deps:
go mod download
go mod tidy
.PHONY: build
build: deps
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/lambda ./cmd/lambda/main.go
.PHONY: zip
zip: build
zip -j bin/lambda.zip bin/lambda
.PHONY: deploy-stg
deploy-stg: zip
aws lambda update-function-code \
--region ap-northeast-1 \
--function-name stg-lgtm-cat-api \
--zip-file fileb://bin/lambda.zip \
--profile lgtm-cat
.PHONY: deploy-prod
deploy-prod: zip
aws lambda update-function-code \
--region ap-northeast-1 \
--function-name prod-lgtm-cat-api \
--zip-file fileb://bin/lambda.zip \
--profile lgtm-cat