forked from captrespect/hallway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (60 loc) · 1.85 KB
/
Makefile
File metadata and controls
79 lines (60 loc) · 1.85 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
export GIT_REVISION?=$(shell git rev-parse --short --default HEAD)
# if not provided by Jenkins, then just use the gitrev
export BUILD_NUMBER?=git-$(GIT_REVISION)
export SUPPRESS_LOGS=true
.PHONY: deps check_deps build npm_modules migrations ltest test lcov cov \
bindist test-bindist clean jenkins all view-cov
all: build
@echo
@echo "Looks like everything worked!"
@echo
# install system level dependencies into deps/
deps:
./scripts/install-deps deps
@echo
@echo "Go ahead and run 'make'"
# check if system level dependencies are installed
check_deps:
@. scripts/use-deps.sh && \
if ! ./scripts/install-deps --check-only; then \
echo Some dependencies are missing. Try running "make deps" to install them.; \
exit 1; \
fi
# Get Hallway ready to run
build: check_deps npm_modules
# install node dependencies via npm
npm_modules:
@. scripts/use-deps.sh && \
npm install
migrations:
@echo "Applying migrations"
./node_modules/db-migrate/bin/db-migrate -v --config Config/config.json -e database up
ltest:
@env CONFIG_PATH="$(shell pwd)/test/resources/config.json" \
scripts/test-harness.sh
test: build ltest
lcov:
@env CONFIG_PATH="$(shell pwd)/test/resources/config.json" \
scripts/test-coverage.sh
cov: build lcov
covershot/index.html: lcov
view-cov: covershot/index.html
@cd covershot && python -mSimpleHTTPServer
SUBDIR=hallway-$(BUILD_NUMBER)
DISTFILE=$(SUBDIR).tar.gz
# create a ready-to-run tarball with a complete build inside
bindist: $(DISTFILE)
$(DISTFILE):
./scripts/build-tarball "$(SUBDIR)" "$@"
# create a ready-to-run tarball, and then run tests on the contents
test-bindist: $(DISTFILE)
./scripts/test-tarball "$(SUBDIR)" "$<"
# this is the rule that Jenkins runs as of 2012-04-18
jenkins:
$(MAKE) test-bindist
clean:
rm -f "$(DISTFILE)"
rm -f "hallway-git-*.tar.gz"
rm -rf covershot
rm -rf lib-cov
rm -rf node_modules