-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (41 loc) · 1.01 KB
/
Makefile
File metadata and controls
54 lines (41 loc) · 1.01 KB
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
docker_local_server_args := \
--rm \
--env AWS_PROFILE=s3-read \
--volume ~/.aws:/root/.aws \
--publish 8000:8000 \
GIT_HASH = $(shell git rev-parse --short HEAD)
ifndef TAG # if kwarg `TAG` not specified
TAG = $(GIT_HASH)
endif
NAME = ann-serve
PORT_CONTAINER = 8000
PORT_HOST = 8000
REGION = us-east-1
REGISTRY_URL = 2jason
GIT_HASH = $(shell git rev-parse --short HEAD)
ifndef TAG # if kwarg `TAG` not specified
TAG = $(GIT_HASH)
endif
# Local Targets
build:
docker build -t ${NAME}:${TAG} .
docker_local_args := \
--rm \
--volume ~/.aws:/root/.aws
run-local:
docker run -it \
$(docker_local_args) \
-p ${PORT_HOST}:${PORT_CONTAINER} \
${NAME}:${TAG}
deploy-local-k8s:
kubectl apply -f k8s/local
# Remote Targets
ecs-login:
$(shell aws ecr get-login --region ${REGION} --no-include-email)
create-repo: ecs-login
aws ecr create-repository --repository-name $(NAME)
build-remote:
docker build \
-t $(REGISTRY_URL)/$(NAME):$(TAG) .
publish: build-remote
docker push $(REGISTRY_URL)/$(NAME):$(TAG)