-
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.
add gh to benny and improve task bootstrapping
- Loading branch information
Showing
5 changed files
with
90 additions
and
17 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
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
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 |
---|---|---|
@@ -1,29 +1,49 @@ | ||
OWNER = anchore | ||
PROJECT = binny | ||
|
||
BINNY_VERSION = v0.1.0 | ||
|
||
TOOL_DIR = .tool | ||
BINNY = $(TOOL_DIR)/binny | ||
TASK = $(TOOL_DIR)/task | ||
|
||
.DEFAULT_GOAL := default | ||
.DEFAULT_GOAL := make-default | ||
|
||
.PHONY: default | ||
default: $(TASK) | ||
$(TASK) $@ | ||
## Bootstrapping targets ################################# | ||
|
||
$(BINNY): | ||
@mkdir -p $(TOOL_DIR) | ||
curl -sSfL https://raw.githubusercontent.com/$(OWNER)/$(PROJECT)/main/install.sh | sh -s -- -b $(TOOL_DIR) $(BINNY_VERSION) | ||
@# we don't have a release of binny yet, so build off of the current branch | ||
@#curl -sSfL https://raw.githubusercontent.com/$(OWNER)/$(PROJECT)/main/install.sh | sh -s -- -b $(TOOL_DIR) | ||
go build -o $(TOOL_DIR)/$(PROJECT) ./cmd/$(PROJECT) | ||
|
||
$(TASK): $(BINNY) | ||
$(BINNY) install task | ||
|
||
# for those of us that can't seem to kick the habit of typing `make ...` | ||
# assume that any other target is a task in the taskfile. | ||
.PHONY: ci-bootstrap-go | ||
ci-bootstrap-go: | ||
go mod download | ||
|
||
.PHONY: ci-bootstrap-tools | ||
ci-bootstrap-tools: $(BINNY) | ||
$(BINNY) install -v | ||
|
||
## Shim targets ################################# | ||
|
||
.PHONY: make-default | ||
make-default: $(TASK) | ||
@# run the default task in the taskfile | ||
@$(TASK) | ||
|
||
# for those of us that can't seem to kick the habit of typing `make ...` lets wrap the superior `task` tool | ||
TASKS := $(shell bash -c "$(TASK) -l | grep '^\* ' | cut -d' ' -f2 | tr -d ':' | tr '\n' ' '" ) $(shell bash -c "$(TASK) -l | grep 'aliases:' | cut -d ':' -f 3 | tr '\n' ' ' | tr -d ','") | ||
|
||
.PHONY: $(TASKS) | ||
$(TASKS): $(TASK) | ||
@$(TASK) $@ | ||
|
||
%: $(TASK) | ||
$(TASK) $@ | ||
# it looks like you tried to run make without task being installed... try running the same command again | ||
echo $(TASKS) | ||
exit 1 | ||
|
||
help: $(TASK) | ||
$(TASK) -l | ||
@$(TASK) -l |
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
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