-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (44 loc) · 1.36 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
57
58
59
60
61
.PHONY: help run build clean setup start-database
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
start-database: ## Start the database
@echo Starting the database container
@if [ $(shell docker ps -a | grep -ci boe-mongo) -eq 0 ]; then \
docker run --name boe-mongo -p 27017:27017 -d mongo --storageEngine wiredTiger > /dev/null; \
elif [ $(shell docker ps | grep -ci boe-mongo) -eq 0 ]; then \
docker start boe-mongo > /dev/null; \
fi
stop-database: ## Stop the database
@echo Stoping the database container
@if [ $(shell docker ps -a | grep -ci boe-mongo) -eq 1 ]; then \
docker stop boe-mongo > /dev/null; \
fi
run: ## Run BoE
run: build
@echo Running BoE
mkdir -p run/ss
rm -rf run/client
rm -rf run/bin
cp -r build/* run/
cd run/; ENV=DEV ./bin/boe
build: ## Build BoE
build: setup
@echo Building BoE
cd BoE-Web && $(MAKE) build
rm -rf build
mkdir -p build/client/
mkdir -p build/bin/
go build -o build/bin/boe main.go
cp -r BoE-Web/build/* build/client/
setup: ## Setup the project
@echo Setting up the project
go get ./...
clean: ## Clean up the build files and web app
clean: stop-database
@echo Cleaning
cd BoE-Web && $(MAKE) clean
rm -rf build
rm -rf run
@if [ $(shell docker ps -a | grep -ci boe-mongo) -eq 1 ]; then \
docker rm -v boe-mongo > /dev/null; \
fi