summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-20 15:13:12 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-24 09:29:02 -0400
commit49c50f95752071c32a3d19aee36566bfa20260df (patch)
tree5113c38612dabb4b9d51d091dce7703b20171bb7 /Makefile
parenta09f35bdcf227835497769feaad7801c2c23c58d (diff)
downloadchat-49c50f95752071c32a3d19aee36566bfa20260df.tar.gz
chat-49c50f95752071c32a3d19aee36566bfa20260df.tar.bz2
chat-49c50f95752071c32a3d19aee36566bfa20260df.zip
Change Makefile to use local copies of dependencies by running go through godep
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile49
1 files changed, 27 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 8793ba98a..28cdce707 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,13 @@ GOPATH ?= $(GOPATH:)
GOFLAGS ?= $(GOFLAGS:)
BUILD_NUMBER ?= $(BUILD_NUMBER:)
+ifeq ($(shell which godep), "")
+ GODEP=$(GOPATH)/bin/godep
+else
+ GODEP=godep
+endif
+GO=$(GODEP) go
+
ifeq ($(BUILD_NUMBER),)
BUILD_NUMBER := dev
endif
@@ -21,29 +28,27 @@ travis:
@echo building for travis
rm -Rf $(DIST_ROOT)
- @go clean $(GOFLAGS) -i ./...
-
+ @$(GO) clean $(GOFLAGS) -i ./...
+
@cd web/react/ && npm install
- @go build $(GOFLAGS) ./...
+ @$(GO) build $(GOFLAGS) ./...
@mkdir -p logs
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
build:
- @go build $(GOFLAGS) ./...
+ @$(GO) build $(GOFLAGS) ./...
install:
@go get $(GOFLAGS) github.com/tools/godep
- @if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 0 ]; then \
- echo restoring go libs using godep; \
- $(GOPATH)/bin/godep restore; \
+ @if [ $(shell docker ps | grep -ci mattermost-mysql) -eq 0 ]; then \
echo starting mattermost-mysql; \
docker run --name mattermost-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mostest \
-e MYSQL_USER=mmuser -e MYSQL_PASSWORD=mostest -e MYSQL_DATABASE=mattermost_test -d mysql > /dev/null; \
@@ -64,15 +69,15 @@ install:
test: install
@mkdir -p logs
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
benchmark: install
@mkdir -p logs
- @go test $(GOFLAGS) -test.v -run=NO_TESTS -bench=$(BENCH) ./api || exit 1
+ @$(GO) test $(GOFLAGS) -test.v -run=NO_TESTS -bench=$(BENCH) ./api || exit 1
cover: install
rm -Rf $(DIST_RESULTS)
@@ -94,7 +99,7 @@ cover: install
clean:
rm -Rf $(DIST_ROOT)
- @go clean $(GOFLAGS) -i ./...
+ @$(GO) clean $(GOFLAGS) -i ./...
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 1 ]; then \
echo stopping mattermost-mysql; \
@@ -124,7 +129,7 @@ run: install
@cd web/react && npm start &
@echo starting go web server
- @go run $(GOFLAGS) mattermost.go -config=config.json &
+ @$(GO) run $(GOFLAGS) mattermost.go -config=config.json &
@echo starting compass watch
@cd web/sass-files && compass watch &
@@ -161,8 +166,8 @@ cleandb:
dist: install
- @go build $(GOFLAGS) -i -a ./...
- @go install $(GOFLAGS) -a ./...
+ @$(GO) build $(GOFLAGS) -i -a ./...
+ @$(GO) install $(GOFLAGS) -a ./...
mkdir -p $(DIST_PATH)/bin
cp $(GOPATH)/bin/platform $(DIST_PATH)/bin