-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (45 loc) · 1.16 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
# Installs project dependencies
.PHONY: deps
deps:
go get github.com/codegangsta/gin
(cd server ; go get -u github.com/golang/dep/cmd/dep ; dep ensure)
(cd client ; npm install )
# Build and minify client
.PHONY: bundle
bundle:
(cd ./client ; npm run build)
# Deploy to GH Pages
.PHONY: deploy
deploy:
make bundle
git subtree push --prefix client/public origin gh-pages
# Build and run Bumper in daemon mode
.PHONY: bumper
DATABASE_URL=https://bumperdevdb.firebaseio.com
SERVER_PORT=9090
bumper:
docker stop bumper 2>&1 || true
docker build -t bumper .
docker run -d --rm \
--name bumper \
-e DATABASE_URL=$(DATABASE_URL) \
-e PORT=$(SERVER_PORT) \
-v $(PWD)/client/public:/app/build \
-p 80:$(SERVER_PORT) \
bumper
# Starts a file server in the web/ directory
.PHONY: web
web:
(cd ./web ; python -m SimpleHTTPServer 8000)
# Starts the client (dev server on port 8080)
.PHONY: client
client:
(cd ./client ; npm start)
# Starts the server (exposed on port 9090)
.PHONY: server
server:
(cd ./server ; DATABASE_URL=$(DATABASE_URL) PORT=8081 gin -p $(SERVER_PORT) -a 8081 -i run main.go)
# Runs unit tests
.PHONY: test
test:
(cd ./server ; go test -race ./...)