-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
56 lines (35 loc) · 1.26 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
####################################################################
## JFrog CLI Plugins registry will use `go build` to build plugin binary.
## This file is added for user's benefit to work with code in local.
####################################################################
SHELL := /bin/bash
.DEFAULT_GOAL = help
GOCMD ?= go
TEST_TAGS ?= -tags=test
.DEFAULT_GOAL = build
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# BUILD:
build: clean ## Build live-logs plugin
$(GOCMD) build
fmt-fix: ## Gofmt fix errors
gofmt -w -s .
vet: ## GoVet
$(GOCMD) vet $(TEST_TAGS) ./...
clean: ## Clean from created bins
rm -f live-logs
run: ## Run the plugin
$(GOCMD) run main.go
# TEST EXECUTION
test: ## Run all tests
time $(GOCMD) test ./... $(TEST_TAGS) -count=1
test-list: ## List all tests
$(GOCMD) list ./...
cover: ## Shows coverage details
$(GOCMD) test ./... $(TEST_TAGS) -count=1 -coverprofile=coverage
# PLUGIN INSTALLATION
install: ## Install the plugin to jfrog cli
jfrog plugin install live-logs
uninstall: ## Uninstall the plugin to jfrog cli
jfrog plugin uninstall live-logs
.PHONY: help build fmt-fix vet clean run test test-list cover install uninstall