Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (86 sloc) 2.12 KB
PKGS := $(shell go list ./... | grep -v 'go.pedge.io/importserver/vendor')
all: build test
deps:
go get -d -v $(PKGS)
updatedeps:
go get -d -v -u -f $(PKGS)
testdeps:
go get -d -v -t $(PKGS)
updatetestdeps:
go get -d -v -t -u -f $(PKGS)
vendor:
go get -v github.com/kardianos/govendor
rm -rf vendor
GOOS=linux GOARCH=amd64 go get -d -v -t -u -f ./...
govendor init
GOOS=linux GOARCH=amd64 govendor add +external
GOOS=linux GOARCH=amd64 govendor update +vendor
build:
go build $(PKGS)
install:
go install $(PKGS)
lint:
go get -v github.com/golang/lint/golint
for file in $$(find . -name '*.go' | grep -v '^\./vendor'); 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 vet errcheck
test: pretest
go test -test.v $(PKGS)
clean:
go clean -i $(PKGS)
rm -rf _tmp
docker-build-dev:
docker build -t quay.io/pedge/go-importserver-dev .
docker-test: docker-build-dev
docker run quay.io/pedge/go-importserver-dev make test
docker-build-internal:
rm -rf _tmp
mkdir -p _tmp
CGO_ENABLED=0 go build -a -installsuffix cgo -o _tmp/importserver cmd/importserver/main.go
docker build -t quay.io/pedge/go-importserver -f Dockerfile.importserver .
docker-build: docker-build-dev
docker run -v /var/run/docker.sock:/var/run/docker.sock quay.io/pedge/go-importserver-dev make docker-build-internal
docker-push: docker-build
docker push quay.io/pedge/go-importserver
docker-dev-launch-internal: install
importserver
docker-dev-launch: docker-build-dev
docker run -p 8080:8080 quay.io/pedge/go-importserver-dev
docker-launch: docker-build
docker run -p 8080:8080 quay.io/pedge/go-importserver
launch:
TEMPLATE_DIR_PATH=etc/template go run cmd/importserver/main.go
.PHONY: \
all \
deps \
updatedeps \
testdeps \
updatetestdeps \
vendornoupdate \
vendor \
build \
install \
lint \
vet \
errcheck \
pretest \
test \
clean \
docker-build-dev \
docker-test \
docker-build-internal \
docker-build \
docker-push \
docker-dev-launch-internal \
docker-dev-launch \
docker-launch \
launch