-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (54 loc) · 1.66 KB
/
Makefile
File metadata and controls
65 lines (54 loc) · 1.66 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
.PHONY: help install server debug test coverage clean-coverage tunnel
include .env
help:
@echo
@echo "Please use 'make <target>' where <target> is one of"
@echo " server to start the server"
@echo " debug to start the server in debug mode"
@echo " test to run tests"
@echo " coverage to generate and review test coverage reports"
@echo " install to install modules and run migrations"
@echo
# Install the required NPM modules and run migrations
install:
@npm update
@npm install
# Run the server!
server:
ifeq (${MODE},dev)
@NODE_ENV=development npx nodemon index.js | ./node_modules/.bin/bunyan
else
@echo "Use PM2 to run in production."
endif
# Debug the server
debug:
ifeq (${MODE},dev)
@echo "Starting up in debug mode..."
@NODE_ENV=development node debug index.js
else
@echo "Cannot debug in production."
endif
# Run all tests, and force exit when done (DB doesn't clean up after itself otherwise)
test:
@NODE_ENV=test jest --forceExit
# Create test coverage report
coverage: clean-coverage
@NODE_ENV=test jest --forceExit --coverage
@open coverage/lcov-report/index.html
clean-coverage:
@rm -rf coverage
# Symlink to slacksimple folder for development
startslacksimpledev:
@mv node_modules/slacksimple node_modules/slacksimple-old
@ln -s ../../slacksimple/ node_modules/slacksimple
@rm -f .git/hooks/pre-commit
@cp .pre-commit .git/hooks/pre-commit
@chmod a+x .git/hooks/pre-commit
# Remove symlink to slacksimple folder
stopslacksimpledev:
@rm node_modules/slacksimple
@mv node_modules/slacksimple-old node_modules/slacksimple
@rm .git/hooks/pre-commit
# Open the tunnel
tunnel:
@ngrok http -subdomain=cnsdev http://localhost:8080