-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (16 loc) · 757 Bytes
/
Makefile
File metadata and controls
22 lines (16 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SHELL := /bin/sh
BINARY_NAME := kubectl-permissions
REV := $(shell git rev-parse --short HEAD 2> /dev/null || echo 'unknown')
GIT_TREE_STATE := $(shell test -z "`git status --porcelain`" && echo "clean" || echo "dirty")
VERSION ?= $(shell echo "$$(git for-each-ref refs/tags/ --count=1 --sort=-version:refname --format='%(refname:short)' 2>/dev/null)-dev+$(REV)-$(GIT_TREE_STATE)" | sed 's/^v//')
build:
go build -o $(BINARY_NAME) -trimpath -ldflags "-X github.com/garethjevans/kubectl-permissions/pkg/version.Version=$(VERSION)" cmd/kubectl-permissions.go
install: build
sudo cp -f $(BINARY_NAME) /usr/local/bin
lint:
golangci-lint run
test:
go test -v -short ./...
.PHONY: integration
integration:
go test -v -run Integration ./integration/...