You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
731 B

GO := GO15VENDOREXPERIMENT=1 go
pkgs = .
DOCKER_IMAGE_NAME ?= challenge/exporter
DOCKER_IMAGE_TAG ?= latest
all: format build test
get:
@echo ">> get dependencies"
@$(GO) get
style:
@echo ">> checking code style"
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
test:
@echo ">> running tests"
@$(GO) test -short $(pkgs)
format:
@echo ">> formatting code"
@$(GO) fmt $(pkgs)
build:
@echo ">> building binaries"
@$(GO) build -o exporter
# do not use static binaries:
# @$(GO) build -tags netgo -a -o exporter
docker:
@echo ">> building docker image"
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
.PHONY: all get style format build test docker