This repository was archived by the owner on Apr 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (59 loc) · 1.77 KB
/
Makefile
File metadata and controls
79 lines (59 loc) · 1.77 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
MAKEFLAGS += --silent
#####################################################################
APP_NAME := codehuddle
REPO := thehuddle
#####################################################################
DEV_TAG := thehuddle/website:dev
BUILDER_TAG := $(REPO)/$(APP_NAME):app-builder
IMAGE_TAG := $(REPO)/$(APP_NAME):app
PROJECT_ROOT := $(shell pwd)
PROJECT_BIN := $(PROJECT_ROOT)/bin
ifdef HUDDLE_AWS_REPOSITORY
REPO := $(HUDDLE_AWS_REPOSITORY)
endif
#####################################################################
default: help
serve: build serve # run angular development server in a container
.: # ---
build: build-prod # build production container
run: run # run production container
.: # ---
help: # print this message
DIR=$(PROJECT_ROOT) NAME=$(APP_NAME) $(PROJECT_BIN)/help
#####################################################################
build:
docker build . \
-f $(PROJECT_ROOT)/docker/Dockerfile.dev \
-t $(DEV_TAG) \
--quiet
serve:
docker run --rm -it \
--publish=4200:4200 \
--mount src="$(PROJECT_ROOT)/src",target=/app/src,type=bind \
$(DEV_TAG) \
ng serve --host=0.0.0.0
#####################################################################
build-prod:
docker build . \
-f $(PROJECT_ROOT)/docker/Dockerfile \
-t $(IMAGE_TAG) \
--quiet
run:
docker run -it \
--publish=4200:80 \
$(IMAGE_TAG)
#####################################################################
ecr-push: aws-docker-login
docker push $(IMAGE_TAG)
ecr-pull: aws-docker-login
docker pull $(IMAGE_TAG)
ifndef HUDDLE_AWS_PROFILE
aws-docker-login:
echo 'missing HUDDLE_AWS_PROFILE'
false
else
aws-docker-login:
aws --profile=$(HUDDLE_AWS_PROFILE) \
ecr get-login-password --region us-east-2 \
| docker login --username AWS --password-stdin $(REPO)
endif