2016-09-05 21:58:49 +00:00
|
|
|
.PHONY: build
|
|
|
|
|
|
|
|
all: build
|
2016-08-10 05:15:44 +00:00
|
|
|
|
|
|
|
.prefix:
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
if not exist build mkdir build
|
|
|
|
else
|
|
|
|
mkdir -p build
|
|
|
|
endif
|
|
|
|
|
2016-09-05 21:58:49 +00:00
|
|
|
build: .prefix
|
2016-09-04 05:13:42 +00:00
|
|
|
ifeq ($(OS), Windows_NT)
|
2016-09-05 21:58:49 +00:00
|
|
|
go build -o build/kolide.exe
|
2016-09-04 05:13:42 +00:00
|
|
|
else
|
2016-09-05 21:58:49 +00:00
|
|
|
go build -o build/kolide
|
2016-09-04 05:13:42 +00:00
|
|
|
endif
|
|
|
|
|
2016-09-06 21:00:34 +00:00
|
|
|
lint-js:
|
|
|
|
$(shell npm bin)/eslint . --ext .js,.jsx
|
|
|
|
|
|
|
|
lint-go:
|
2016-09-04 05:13:42 +00:00
|
|
|
go vet $(shell glide nv)
|
2016-09-06 21:00:34 +00:00
|
|
|
|
|
|
|
lint: lint-go lint-js
|
|
|
|
|
|
|
|
test-go:
|
2016-09-05 21:58:49 +00:00
|
|
|
go test -v -cover $(shell glide nv)
|
2016-09-06 21:00:34 +00:00
|
|
|
|
|
|
|
test-js:
|
2016-09-06 21:13:03 +00:00
|
|
|
$(shell npm bin)/_mocha --compilers js:babel-core/register --recursive 'frontend/**/*.tests.js*' --require 'frontend/.test.setup.js'
|
2016-09-06 21:00:34 +00:00
|
|
|
|
|
|
|
test: lint test-go test-js
|
2016-09-04 05:13:42 +00:00
|
|
|
|
2016-08-10 05:15:44 +00:00
|
|
|
generate: .prefix
|
2016-09-12 16:11:18 +00:00
|
|
|
go-bindata -pkg=server -o=server/bindata.go frontend/templates/ assets/ assets/images/
|
2016-09-06 15:08:11 +00:00
|
|
|
$(shell npm bin)/webpack --progress --colors --bail
|
|
|
|
|
|
|
|
generate-dev: .prefix
|
2016-09-13 19:50:37 +00:00
|
|
|
go-bindata -debug -pkg=server -o=server/bindata.go frontend/templates/ assets/...
|
2016-09-06 15:23:33 +00:00
|
|
|
$(shell npm bin)/webpack --progress --colors --bail --watch
|
2016-08-10 05:15:44 +00:00
|
|
|
|
|
|
|
deps:
|
2016-09-08 02:57:05 +00:00
|
|
|
npm install
|
2016-08-13 21:49:19 +00:00
|
|
|
go get -u github.com/Masterminds/glide
|
2016-08-10 15:31:27 +00:00
|
|
|
go get -u github.com/jteeuwen/go-bindata/...
|
2016-08-13 21:49:19 +00:00
|
|
|
glide install
|
2016-08-10 05:15:44 +00:00
|
|
|
|
2016-08-10 15:31:27 +00:00
|
|
|
distclean:
|
2016-08-10 05:15:44 +00:00
|
|
|
rm -rf build/*
|
2016-09-12 16:11:18 +00:00
|
|
|
rm -rf assets/bundle.js
|
2016-08-13 21:49:19 +00:00
|
|
|
rm -rf vendor/*
|
2016-08-10 05:15:44 +00:00
|
|
|
|
2016-08-25 13:25:02 +00:00
|
|
|
docker:
|
2016-09-05 21:58:49 +00:00
|
|
|
docker pull kolide/kolide-builder:1.7
|
|
|
|
docker run --rm -it -v $(shell pwd):/go/src/github.com/kolide/kolide-ose -v ${GOPATH}/pkg:/go/pkg kolide/kolide-builder:1.7 -B
|
2016-08-25 13:25:02 +00:00
|
|
|
docker-compose up
|