.PHONY: all precommit setup lint test integration_test build run fix jenkins
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
include $(SELF_DIR)helpers/CommonMakefile.mk
all: setup lint test build

MAIN_DIR ?= ./cmd/ecs-deploy

GOMETALINTER_ARGS = --vendor --dupl-threshold=150 --min-confidence=.3 --tests --deadline=90s --disable-all \
	-Egolint -Etest -Eineffassign -Etestify -Eunconvert -Estaticcheck -Egoconst -Eerrcheck \
	-Egofmt -Evet -Edupl -Einterfacer -Estructcheck -Evetshadow -Egoimports -Evarcheck -Emisspell \
	-Etest --exclude=/usr/local/go/src --exclude='/mocks/[^/]+\.go.*\((dupl)|(golint)\)' ./...

jenkins: setup test
	go build -ldflags "-linkmode external -extldflags -static" -o ./cmd/ecs-deploy/ecs-deploy $(MAIN_DIR)
	go build -ldflags "-linkmode external -extldflags -static" -race -o ./cmd/ecs-deploy/ecs-deploy_race $(MAIN_DIR)

revendor:
	dep ensure
	dep prune
