-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
27 lines (22 loc) · 900 Bytes
/
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
.ONESHELL:
PROJECT := coder-labeler
COMMIT_SHA := $(shell git rev-parse --short HEAD)
DOCKER_TAG := us-central1-docker.pkg.dev/$(PROJECT)/labeler/labeler:$(COMMIT_SHA)
.PHONY: build push deploy
build:
# May need to run:
# gcloud auth configure-docker \
# us-central1-docker.pkg.dev
mkdir -p bin
GOOS=linux GOARCH=amd64 go build -o bin/labeler ./cmd/labeler
docker build -t $(DOCKER_TAG) .
push: build
docker push $(DOCKER_TAG)
deploy: push
# we keep CPU always allocated for background processing issue
# indexing (WIP) and to eventually set labels outside of the
# request-response cycle (escaping 10s webhook timeout)
gcloud run deploy labeler --project $(PROJECT) --image $(DOCKER_TAG) --region us-central1 \
--allow-unauthenticated --memory=512Mi \
--min-instances=1 --no-cpu-throttling \
--set-secrets=OPENAI_API_KEY=openai-key:latest,GITHUB_APP_PEM=github-app-key:latest