-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
52 lines (38 loc) · 1.28 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
BINARY=redalert
VERSION=0.2.4
COMMIT=`git rev-parse HEAD`
LDFLAGS=-ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT}"
install-deps:
glide install
build: embed-static
go build ${LDFLAGS} -o ${BINARY}
embed-static: build-ui
go get github.com/GeertJohan/go.rice
go get github.com/GeertJohan/go.rice/rice
cd web && rice embed-go && cd ..
build-ui:
cd ui && npm install && NODE_ENV=production ./node_modules/.bin/webpack -p && cd ..
mkdir -p web/assets
cp ui/dist/assets/app.bundle.js web/assets/
cp ui/index.html web/assets
run-dev-ui:
cd ui && npm install && ./node_modules/.bin/webpack-dev-server
build-proto:
protoc -I servicepb/ servicepb/service.proto --go_out=plugins=grpc:servicepb
clean:
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
test-deps:
docker pull sickp/alpine-sshd
docker pull postgres
test:
go test -v -race $(shell glide novendor)
build-docker-image-local: embed-static
docker run --rm \
-v "$(shell pwd):/src" \
-v /var/run/docker.sock:/var/run/docker.sock \
centurylink/golang-builder \
jonog/redalert
build-docker-image-remote: build-docker-image-local
docker tag jonog/redalert jonog/redalert:v${VERSION}
docker push jonog/redalert
.PHONY: embed-static build-ui build-proto clean test-deps test build-docker-image build-docker-image-remote