-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
56 lines (46 loc) · 1.67 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
# This file is the development Makefile for the bully-algorithm project.
# All variables listed here are used as substitution in these Makefile targets.
SERVICE-NAME = bully-algorithm
define ENV-CONFIGURATION
ENV='dev'
endef
################################################################################
# Install all dependencies required.
#
# NOTE: Docker & Docker Compose should already be installed.
.PHONY: install
install:
curl https://glide.sh/get | sh
go get -u github.com/alecthomas/gometalinter
gometalinter --install
glide update
glide install
# Build project binaries.
.PHONY: build
build: lint
cd cmd/bully && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o bully
cd cmd/data-viz && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o data-viz
# Build project Docker images for dev environment.
.PHONY: docker-build
docker-build: build
cp cmd/bully/conf/bully.conf.yaml build/docker/bully/ && \
cp cmd/bully/bully build/docker/bully/ && \
docker build -t timtosi/bully:latest build/docker/bully/ && \
cp cmd/data-viz/data-viz build/docker/data-viz/ && \
cp -r cmd/data-viz/assets build/docker/data-viz/ && \
docker build -t timtosi/data-viz:latest build/docker/data-viz/
# Runs linter against the service codebase.
#
# NOTE: This rule require gcc to be found in the `$PATH`.
.PHONY: lint
lint:
@gometalinter --config=conf/gometalinter_conf.json ./... && \
echo "linter pass ok !"
# Runs test suite.
.PHONY: test
test: lint
go test -v -coverprofile=coverage.txt -tags integration -race -cover -timeout=120s $$(glide novendor)
# Run project locally.
.PHONY: run
run:
docker-compose -f deployments/docker-compose.yaml up