-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
83 lines (60 loc) · 1.47 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
DOCKERHUB_USER="chechiachang"
# Build
#
get:
go get -v ./...
.PHONY: build
build: get
go build ./...
db:
docker run -d --name mongo -p 27017:27017 mongo
migrate:
docker cp data/mongodb/scouter mongo:.
docker exec -it mongo bash -c "mongorestore -d scouter scouter"
# Test & Run
#
PYTHON = $(shell which python)
.PHONY: test
test:
go test ./...
.PHONY: apiserver
apiserver:
${PYTHON} ./face_recognition/apiserver.py
# Build & ship
#
.PHONY: encodings
encoding:
rm -f face_recognition/encodings face_recognition/index
${PYTHON} ./face_recognition/encoding_file_generator.py
.PHONY: base
base:
time docker build \
--tag $(DOCKERHUB_USER)/scouter-apiserver-base \
--file face_recognition/base/Dockerfile .
.PHONY: image
image:
time docker build \
--tag $(DOCKERHUB_USER)/scouter-apiserver \
--file face_recognition/Dockerfile .
.PHONY: unity
add-unity:
cp -rf /Users/Shared/Unity/scouter/Assets/Scouter unity/Assets/
unity:
cp -rf unity/Assets/Scouter /Users/Shared/Unity/scouter/Assets
clean:
rm -f avatar_downloader contribution_fetcher user_detail_fetcher user_fetcher
# Prerequisite
#
UNAME := $(shell uname)
PORT := $(shell which port)
BREW := $(shell which brew)
ifeq ($(UNAME), Linux)
prerequisite:
sudo apt-get update && \
sudo apt-get install -y python3 python3-pip
else ifeq ($(UNAME), Darwin)
prerequisite:
if [[ "$(PORT)" != "" ]]; then sudo port install coreutils; fi
if [[ "$(BREW)" != "" ]]; then brew install coreutils; fi
rehash
endif