2018-11-04 14:58:15 +00:00
|
|
|
PROJECT_NAME=ytsflix
|
2020-05-31 13:54:24 +00:00
|
|
|
PKG := git.adphi.net/adphi/$(PROJECT_NAME)
|
2018-11-04 14:58:15 +00:00
|
|
|
VERSION=0.0.2
|
|
|
|
GOPATH:=$(shell go env GOPATH)
|
|
|
|
|
|
|
|
.PHONY: tests deps build docker push coverage
|
|
|
|
|
2020-05-31 13:54:24 +00:00
|
|
|
all: tests coverage build docker push## Run all commands except docker
|
2018-11-04 14:58:15 +00:00
|
|
|
all-docker: docker push ## Run all docker commands
|
|
|
|
|
|
|
|
|
|
|
|
tests: ## Run test suite
|
|
|
|
@go test -v ./... -cover
|
|
|
|
|
|
|
|
coverage: ## Generate global code coverage report
|
|
|
|
@mkdir -p cover
|
|
|
|
@touch cover/${PROJECT_NAME}cov
|
|
|
|
go tool cover -html=cover/${PROJECT_NAME}cov -o coverage.html
|
|
|
|
|
|
|
|
|
2020-05-31 13:54:24 +00:00
|
|
|
docker: ## Build Docker images
|
2018-11-04 14:58:15 +00:00
|
|
|
@docker build -f Dockerfile -t adphi/${PROJECT_NAME}:latest -t adphi/${PROJECT_NAME}:${VERSION} .
|
|
|
|
|
|
|
|
push : ## Push Docker images
|
|
|
|
@docker push adphi/${PROJECT_NAME}:latest
|
|
|
|
@docker push adphi/${PROJECT_NAME}:${VERSION}
|
|
|
|
|
|
|
|
build: ## Build service
|
|
|
|
@go build -v -o build/${PROJECT_NAME} cmd/main.go
|
|
|
|
|
|
|
|
help: ## Display this help screen
|
|
|
|
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|