-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Shiwei Zhang <[email protected]>
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
DOCKER_PLUGINS = docker-ratify | ||
GO_BUILD_FLAGS = | ||
|
||
.PHONY: help | ||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: all | ||
all: build | ||
|
||
.PHONY: FORCE | ||
FORCE: | ||
|
||
bin/%: cmd/% FORCE | ||
go build $(GO_BUILD_FLAGS) -o $@ ./$< | ||
|
||
.PHONY: build | ||
build: $(addprefix bin/,$(DOCKER_PLUGINS)) ## builds binaries | ||
|
||
.PHONY: install | ||
install: $(addprefix install-,$(DOCKER_PLUGINS)) ## installs the docker plugins | ||
|
||
.PHONY: install-docker-% | ||
install-docker-%: bin/docker-% | ||
cp $< ~/.docker/cli-plugins/ | ||
|
||
.PHONY: check-line-endings | ||
check-line-endings: ## check line endings | ||
! find . -name "*.go" -type f -exec file "{}" ";" | grep CRLF | ||
|
||
.PHONY: fix-line-endings | ||
fix-line-endings: ## fix line endings | ||
find . -type f -name "*.go" -exec sed -i -e "s/\r//g" {} + |