Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
102 lines (79 sloc) 1.95 KB
all: build test
version:
@echo 'package main; import "go.pedge.io/base"; func main() { base.Version.Println() }' > /tmp/base_version.go
@go run /tmp/base_version.go
deps:
go get -d -v ./...
updatedeps:
go get -d -v -u -f ./...
testdeps:
go get -d -v -t ./...
updatetestdeps:
go get -d -v -t -u -f ./...
build: deps
go build ./...
install: deps
go install ./...
lint: testdeps
go get -v github.com/golang/lint/golint
for file in $$(find . -name '*.go' | grep -v '\.pb\.go' | grep -v '\.pb\.gw\.go'); do \
golint $${file}; \
if [ -n "$$(golint $${file})" ]; then \
exit 1; \
fi; \
done
vet: testdeps
go vet ./...
errcheck: testdeps
go get -v github.com/kisielk/errcheck
errcheck ./...
pretest: lint errcheck
test: testdeps pretest
go test ./...
clean:
go clean -i ./...
proto:
go get -v go.pedge.io/protoeasy/cmd/protoeasy
go get -v go.pedge.io/pkg/cmd/strip-package-comments
protoeasy --go --grpc --grpc-gateway .
find . -name *\.pb\*\.go | xargs strip-package-comments
docker-build-basedev:
docker build -t quay.io/pedge/basedev -f Dockerfile.basedev .
docker-build-based-internal: deps
rm -rf _tmp
mkdir -p _tmp
CGO_ENABLED=0 go build -a -installsuffix cgo -o _tmp/based cmd/based/main.go
docker build -t quay.io/pedge/based -f Dockerfile.based .
docker-build-based: docker-build-basedev
docker run -v /var/run/docker.sock:/var/run/docker.sock quay.io/pedge/basedev make docker-build-based-internal
docker-test: docker-build-basedev
docker run quay.io/pedge/basedev make test
docker-launch: docker-build-based
docker run -d -p 7070:7070 -p 8080:8080 quay.io/pedge/based
launch: deps
go run cmd/based/main.go
run: deps
go run cmd/basesimple/main.go
.PHONY: \
all \
version \
deps \
updatedeps \
testdeps \
updatetestdeps \
build \
install \
lint \
vet \
errcheck \
pretest \
test \
clean \
proto \
docker-build-basedev \
docker-build-based-internal \
docker-build-based \
docker-test \
docker-launch \
launch \
run