-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (47 loc) · 1.2 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
# Default target: print this help message
.PHONY: help
.DEFAULT_GOAL := help
help:
@echo 'Usage:'
@echo ' make <target>'
@echo ''
@echo 'Targets:'
@sed -n 's/^##//p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /'
## genkit: Run Genkit locally
.PHONY: genkit
genkit:
cd genkit && genkit start
## dev: Run http server locally
.PHONY: dev
dev:
export FUNCTION_TARGET=SummarizeHTTP && go run cmd/main.go
## start-emulator: Run Cloud Functions emulator locally
.PHONY: start-emulator
start-emulator:
gcloud alpha functions local deploy summarize-function \
--runtime=go122 \
--source=. \
--env-vars-file=.env.yaml \
--entry-point=SummarizeHTTP
## remove-emulator: Remove Cloud Functions emulator locally
.PHONY: remove-emulator
remove-emulator:
gcloud alpha functions local delete summarize-function
## deploy: Deploy Cloud Functions
.PHONY: deploy
deploy:
gcloud functions deploy summarize-function \
--gen2 \
--runtime=go122 \
--region=us-central1 \
--source=. \
--env-vars-file=.env.yaml \
--entry-point=SummarizeHTTP \
--trigger-http \
--allow-unauthenticated
## tidy: Tidy modfiles, format and lint .go files
.PHONY: tidy
tidy:
go mod tidy -v
go fmt ./...
golangci-lint run