forked from aws-controllers-k8s/ec2-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (21 loc) · 734 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
SHELL := /bin/bash # Use bash syntax
# Set up variables
GO111MODULE=on
# Build ldflags
VERSION=$(shell git describe --tags --always --dirty)
GITCOMMIT=$(shell git rev-parse HEAD)
BUILDDATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
GO_LDFLAGS=-ldflags "-X main.version=$(VERSION) \
-X main.buildHash=$(GITCOMMIT) \
-X main.buildDate=$(BUILDDATE)"
.PHONY: all test local-test
all: test
test: ## Run code tests
go test -v ./...
local-test: ## Run code tests using go.local.mod file
go test -modfile=go.local.mod -v ./...
help: ## Show this help.
@grep -F -h "##" $(MAKEFILE_LIST) | grep -F -v grep | sed -e 's/\\$$//' \
| awk -F'[:#]' '{print $$1 = sprintf("%-30s", $$1), $$4}'
version:
@echo ${VERSION}