-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
28 lines (17 loc) · 980 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
.PHONY: build-protobufs build-docker cert upload-cert run-client
build-protobufs:
python -m grpc_tools.protoc -I . --python_out=route_guide --grpc_python_out=route_guide ./route_guide.proto
# Builds and push image to ECR
build-docker:
docker build -t route_guide:latest -f Dockerfile.aws .
aws --profile $(AWS_PROFILE) ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(ECR_REPO)
docker tag route_guide:latest $(ECR_REPO)/route_guide:latest
docker push $(ECR_REPO)/route_guide:latest
## Create certificates to encrypt the gRPC connection
cert:
openssl genrsa -out server.key 2048
openssl req -nodes -new -x509 -sha256 -days 1825 -config certificate.conf -extensions 'req_ext' -key server.key -out server.crt
upload-cert:
aws --profile $(AWS_PROFILE) acm import-certificate --certificate fileb://server.crt --private-key fileb://server.key
run-client:
PYTHONPATH="${PWD}/route_guide" python route_guide_client.py --secure