1ebd66d880
* wip post-demos cleanup * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Reorganize: storage ├── common │ └── common.go `package storage` ├── boltdb │ └── ... └── redis └── ... storage ├── common.go `package storage` ├── boltdb │ └── ... └── redis └── ... storage ├── common │ ├── common.go `package storage` │ └── testing.go `package storage` <-- └── ... internal ├── app │ └── cli ├── pkg │ └── readcloser └── test └── util.go `package test` <-- * remove comment * add and use goimports * add test types & fix some lint errors * better typing * fixing linter issues/comments * goimports * goimports * more linter fixes; replace panic with NoError assertions in tests * fix typo/more linter errors * moar better linter fixes * even moar better linter fixes * linter * add localPort back * fixing exports, imports, and add comments
68 lines
1.3 KiB
Makefile
68 lines
1.3 KiB
Makefile
.PHONY: test lint proto check-copyrights build-dev-deps
|
|
|
|
lint: check-copyrights
|
|
@echo "Running ${@}"
|
|
@gometalinter \
|
|
--deadline=170s \
|
|
--disable-all \
|
|
--enable=golint \
|
|
--enable=goimports \
|
|
--enable=vet \
|
|
--enable=deadcode \
|
|
--enable=goconst \
|
|
--exclude=.*\.pb\.go \
|
|
--exclude=.*_test.go \
|
|
./...
|
|
|
|
check-copyrights:
|
|
@echo "Running ${@}"
|
|
@./scripts/check-for-header.sh
|
|
|
|
# Applies goimports to every go file (excluding vendored files)
|
|
goimports-fix:
|
|
goimports -w $$(find . -type f -name '*.go' -not -path "*/vendor/*")
|
|
|
|
proto:
|
|
@echo "Running ${@}"
|
|
./scripts/build-protos.sh
|
|
|
|
build-dev-deps:
|
|
go get github.com/golang/protobuf/protoc-gen-go
|
|
go get github.com/alecthomas/gometalinter
|
|
gometalinter --install --force
|
|
|
|
test: lint
|
|
go install -v ./...
|
|
go test ./...
|
|
@echo done
|
|
|
|
build-binaries:
|
|
docker build -t overlay .
|
|
|
|
run-overlay:
|
|
docker network create test-net
|
|
|
|
docker run -d \
|
|
--name redis \
|
|
--network test-net \
|
|
-p 127.0.0.1:6379:6379 \
|
|
redis
|
|
|
|
docker run -d \
|
|
--name=overlay \
|
|
--network test-net \
|
|
-e REDIS_ADDRESS=redis:6379 \
|
|
-e REDIS_PASSWORD="" \
|
|
-e REDIS_DB=1 \
|
|
-e OVERLAY_PORT=8080 \
|
|
overlay
|
|
|
|
clean-local:
|
|
# cleanup overlay
|
|
docker stop overlay || true
|
|
docker rm overlay || true
|
|
# cleanup redis
|
|
docker stop redis || true
|
|
docker rm redis || true
|
|
# cleanup docker network
|
|
docker network rm test-net || true
|