-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·38 lines (29 loc) · 800 Bytes
/
Makefile
File metadata and controls
executable file
·38 lines (29 loc) · 800 Bytes
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
37
38
# General
WORKDIR = $(PWD)
# Go parameters
GOCMD = go
GOTEST = $(GOCMD) test -v
# Git config
GIT_VERSION ?=
GIT_DIST_PATH ?= $(PWD)/.git-dist
GIT_REPOSITORY = http://github.com/git/git.git
# Coverage
COVERAGE_REPORT = coverage.txt
COVERAGE_MODE = atomic
NAME=docker-hub-cli
ifneq ($(origin CI), undefined)
WORKDIR := $(GOPATH)/src/github.com/$(NAME)
endif
build:
gox -os="linux" -arch="amd64" -output="$(NAME).{{.OS}}.{{.Arch}}" -ldflags "-s -w -X main.Rev=`git rev-parse --short HEAD`" -verbose ./...
install:
go build -i -o $(GOPATH)/bin/$(NAME) ./cmd
test:
@cd $(WORKDIR); \
$(GOTEST) ./...
test-coverage:
@cd $(WORKDIR); \
echo "" > $(COVERAGE_REPORT); \
$(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./...
clean:
rm -rf $(GIT_DIST_PATH)