-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (30 loc) · 867 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
28
29
30
31
32
33
34
35
36
37
CLUSTER?=thesaurus
ZONE?=us-central1-a
TAG?=$(shell git rev-parse --short HEAD)
PROJECT?=thesaurus-207318
IMAGE?=gcr.io/$(PROJECT)/thesaurus
cluster:
gcloud container clusters create $(CLUSTER) \
--machine-type n1-highmem-2 \
--num-nodes 1 \
--enable-autoscaling \
--min-nodes 1 \
--max-nodes 3 \
--zone $(ZONE) \
--project $(PROJECT)
credentials:
gcloud auth configure-docker
gcloud container clusters get-credentials --project=$(PROJECT) --zone=$(ZONE) $(CLUSTER)
build:
yarn build
docker build -t $(IMAGE):latest -t $(IMAGE):$(TAG) .
push:
docker push $(IMAGE):$(TAG)
docker push $(IMAGE):latest
rollout:
gcloud container images describe $(IMAGE):$(TAG)
cat deploy.yml | sed 's/TAG/$(TAG)/g' | kubectl apply -f -
kubectl rollout status deployment/thesaurus-deployment
deploy: build push rollout
serve:
ENV=development python app.py