-
Notifications
You must be signed in to change notification settings - Fork 36
Add makefile #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add makefile #15
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,51 @@ | ||
| DOCKER_REGISTRY ?= gcr.io/linkerd-io | ||
| REPO = $(DOCKER_REGISTRY)/proxy-init | ||
| TESTER_REPO = buoyantio/iptables-tester | ||
|
|
||
| .DEFAULT_GOAL := help | ||
|
|
||
| .PHONY: help | ||
| help: ## Show this help | ||
| @echo 'Info: For integration test using KinD, run make kind-load integration-test' | ||
| @echo 'Info: For other environments, run make integration-test after having uploaded the images' | ||
| @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
|
||
| ############### | ||
| # Go | ||
| ############### | ||
| .PHONY: build | ||
| build: ## Build the project | ||
| go build -o out/linkerd2-proxy-init main.go | ||
|
|
||
| .PHONY: run | ||
| run: ## Run the project | ||
| go run main.go | ||
|
|
||
| .PHONY: test | ||
| test: ## Perform unit test | ||
| go test -v ./... | ||
|
|
||
| .PHONY: fmt | ||
| fmt: ## Check the code formatting | ||
| gofmt -d . | ||
| test -z "$(shell gofmt -d .)" | ||
|
|
||
| .PHONY: integration-test | ||
| integration-test: image ## Perform integration test | ||
| cd integration_test && ./run_tests.sh | ||
|
|
||
| ############### | ||
| # Docker | ||
| ############### | ||
| .PHONY: image | ||
| image: ## Build docker image for the project | ||
| docker build -t $(REPO):latest . | ||
|
|
||
| .PHONY: tester-image | ||
| tester-image: ## Build docker image for the tester component | ||
| docker build -t $(TESTER_REPO):v1 -f ./integration_test/iptables/Dockerfile-tester ./integration_test | ||
|
|
||
| .PHONY: kind-load | ||
| kind-load: image tester-image ## Load the required image to KinD cluster | ||
| kind load docker-image $(REPO):latest | ||
| kind load docker-image $(TESTER_REPO):v1 | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loved this technique, I'm gonna steal it 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
I got it from here https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html