forked from globocom/functions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (45 loc) · 1.41 KB
/
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
52
53
54
55
56
.PHONY: run setup test setup_upgrade install_node setup_nvm lint clean
help:
@echo ' setup .................... sets up project dependencies'
@echo ' run ...................... runs project'
@echo ' test ..................... runs tests'
@echo ' setup_upgrade ............ upgrades project dependencies'
@echo ' clean .................... deletes project dependencies'
@echo ' install_node.............. sets up node version'
@echo ' setup_nvm ................ sets up nvm'
@echo ' lint ..................... runs code linter'
setup: install_node
npm install
run:
npm run start_dev
test:
npm test
$(MAKE) lint
setup_upgrade: clean
npm install
npm shrinkwrap
install_node:
@if test -d ~/.nodenv; then \
echo "Nodenv is already installed"; \
bash -c "nodenv global 6.9.5"; \
else \
make setup_nvm; \
bash -c "source ~/.nvm/nvm.sh && nvm install 6.9.5 && nvm use 6.9.5"; \
echo "Add these lines to your bash_profile, bashrc ..."; \
echo " source ~/.nvm/nvm.sh"; \
echo " [[ -r $NVM_DIR/bash_completion ]] && . $NVM_DIR/bash_completion"; \
fi
setup_nvm:
@if [ test -d ~/.nvm ]; then \
echo "Nvm is already installed"; \
else \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash; \
fi
lint:
npm run lint
clean:
-rm -rf node_modules
docker_build:
docker build -t globobackstage/functions .
docker_push:
docker push globobackstage/functions