-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (40 loc) · 1016 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
NAME = docker-brackets
NODE_MODULES_DIR = node_modules
#ifdef USE_DOCKER
DOCKER_NPM = docker run -it --rm \
-v "$(CURDIR)":/usr/src/app \
-w /usr/src/app \
iegik/docker-node
DOCKER_APP = docker run -it --rm \
-p 3000:3000 \
-v "$(CURDIR)":/usr/src/app \
-v "$$HOME/Development":/usr/src/projects \
-v "$$HOME/.ssh/known_hosts":/root/.ssh/known_hosts \
-v $(SSH_AUTH_SOCK):/tmp/ssh_agent \
-e SSH_AUTH_SOCK=/tmp/ssh_agent \
-w /usr/src/app \
--name $(NAME) \
iegik/docker-node
DOCKER_RUN = docker exec -it \
$(NAME) \
#endif
help:
@echo "USAGE\n\n" \
"dep - Install dependencies.\n" \
"build - Build project.\n" \
"clean - Clean project.\n" \
.PHONY: dep build clean
$(NODE_MODULES_DIR): package.json
@$(DOCKER_NPM) \
npm install --unsafe-perm
dep: $(NODE_MODULES_DIR)
build: dep
@$(DOCKER_APP) \
npm start $(ARGS)
run\:%:
@$(DOCKER_RUN) \
$(subst run:,,$@) $(ARGS)
clean:
@docker \
rm -f $(NAME) && $(DOCKER_NPM) \
rm -rf $(NODE_MODULES_DIR) brackets*