Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
126 lines (96 sloc) 2.49 KB
PKGS := $(shell go list ./... | grep -v 'go.pedge.io/days/vendor')
export GO15VENDOREXPERIMENT=1
all: test
deps:
GO15VENDOREXPERIMENT=0 go get -d -v $(PKGS)
updatedeps:
GO15VENDOREXPERIMENT=0 go get -d -v -u -f $(PKGS)
testdeps:
GO15VENDOREXPERIMENT=0 go get -d -v -t $(PKGS)
updatetestdeps:
GO15VENDOREXPERIMENT=0 go get -d -v -t -u -f $(PKGS)
vendornoupdate:
go get -v github.com/kardianos/govendor
rm -rf vendor
govendor init
GOOS=linux GOARCH=amd64 govendor add +external
GOOS=linux GOARCH=amd64 govendor update +vendor
vendor: updatetestdeps vendornoupdate
build:
go build $(PKGS)
install:
go install go.pedge.io/days/go/cmd/daysd
lint:
go get -v github.com/golang/lint/golint
for file in $$(find . -name '*.go' | grep -v 'vendor' | grep -v '\.pb\.go' | grep -v '\.pb\.gw\.go'); do \
golint $${file}; \
if [ -n "$$(golint $${file})" ]; then \
exit 1; \
fi; \
done
vet:
go vet $(PKGS)
errcheck:
go get -v github.com/kisielk/errcheck
errcheck $(PKGS)
pretest: lint
test: pretest
go test -v $(PKGS)
clean:
go clean -i $(PKGS)
proto:
go get -v go.pedge.io/protoeasy/cmd/protoeasy
protoeasy --grpc --go --go-rel-out go --go-import-path go.pedge.io/days/go --out . proto
generate:
go get -v github.com/variadico/scaneo
go generate ./go/...
docker-build-days-dev:
docker build -t quay.io/pedge/days-dev -f Dockerfile.days-dev .
docker-run-days-dev-internal: install
daysd
docker-build-daysd-internal:
rm -rf _tmp
mkdir -p _tmp
CGO_ENABLED=0 go build -a -installsuffix cgo -o _tmp/daysd go/cmd/daysd/main.go
docker build -t quay.io/pedge/daysd -f Dockerfile.daysd .
docker-build-daysd: docker-build-days-dev
docker run -v /var/run/docker.sock:/var/run/docker.sock quay.io/pedge/days-dev make docker-build-daysd-internal
docker-test: docker-build-days-dev
docker run quay.io/pedge/days-dev make test
docker-push: docker-build-daysd
docker push quay.io/pedge/daysd
docker-dev-launch: docker-build-days-dev
docker run -d -p 8080:8080 quay.io/pedge/days-dev
docker-launch: docker-build-daysd
docker run -d -p 8080:8080 quay.io/pedge/daysd
launch:
go run go/cmd/daysd/main.go
deploy: docker-push
eb deploy
.PHONY: \
all \
deps \
updatedeps \
testdeps \
updatetestdeps \
vendornoupdate \
vendor \
build \
install \
lint \
vet \
errcheck \
pretest \
test \
clean \
proto \
generate \
docker-build-days-dev \
docker-run-days-dev-internal \
docker-build-daysd-internal \
docker-build-daysd \
docker-test \
docker-dev-launch \
docker-launch \
launch \
deploy