-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (29 loc) · 968 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.DEFAULT_GOAL := help
SHELL := bash
GOFLAGS :=
PROGRAM := main
.PHONY: deps
deps:
@echo "==> Installing dependencies"
if ! command -V govvv; then go get -u github.com/ahmetb/govvv; go mod tidy; fi
.PHONY: build
build: deps ## Build the program for Linux
@echo "==> Building the program for Linux"
$(GOFLAGS) CGO_ENABLED=0 GOOS=linux govvv build -v -o $(PROGRAM)
clean: ## Clean temporary files
@echo "==> Cleaning temporary files"
go clean
rm -f $(PROGRAM)
.PHONY: docker
docker: ## Build a docker image for local dev
docker build -t drone-github-comment:local .
.PHONY: test
test: ## Run all tests
#TODO: Update this when tests are created
$(GOFLAGS) go test ./...
.PHONY: help
help: ## Print list of Makefile targets.
@# Taken from https://github.com/spf13/hugo/blob/master/Makefile
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
cut -d ":" -f1- | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'