31 lines
994 B
Makefile
31 lines
994 B
Makefile
NAME := k9s
|
|
PACKAGE := github.com/derailed/$(NAME)
|
|
GIT := $(shell git rev-parse --short HEAD)
|
|
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
VERSION ?= v0.24.3
|
|
IMG_NAME := derailed/k9s
|
|
IMAGE := ${IMG_NAME}:${VERSION}
|
|
|
|
default: help
|
|
|
|
test: ## Run all tests
|
|
@go clean --testcache && go test ./...
|
|
|
|
cover: ## Run test coverage suite
|
|
@go test ./... --coverprofile=cov.out
|
|
@go tool cover --html=cov.out
|
|
|
|
build: ## Builds the CLI
|
|
@go build \
|
|
-ldflags "-w -s -X ${PACKAGE}/cmd.version=${VERSION} -X ${PACKAGE}/cmd.commit=${GIT} -X ${PACKAGE}/cmd.date=${DATE}" \
|
|
-a -tags netgo -o execs/${NAME} main.go
|
|
|
|
kubectl-stable-version: ## Get kubectl latest stable version
|
|
@curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt
|
|
|
|
img: ## Build Docker Image
|
|
@docker build --rm -t ${IMAGE} .
|
|
|
|
help:
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":[^:]*?## "}; {printf "\033[38;5;69m%-30s\033[38;5;38m %s\033[0m\n", $$1, $$2}'
|