-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
2,022 additions
and
242 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.idea/ | ||
go.sum | ||
bin |
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,51 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
BIN_DIR = ${PWD}/bin | ||
|
||
.PHONY: clean download tools lint test generate test-integration terraform-fmt | ||
|
||
RED=$(shell tput -T xterm setaf 1) | ||
GREEN=$(shell tput -T xterm setaf 2) | ||
YELLOW=$(shell tput -T xterm setaf 3) | ||
RESET=$(shell tput -T xterm sgr0) | ||
|
||
DOCKER_IMAGE ?= connectivity_controller | ||
|
||
|
||
export GOPRIVATE=github.com/reemote/* | ||
export PATH := ${BIN_DIR}:$(PATH) | ||
|
||
tools: ## Installing tools from tools.go | ||
- echo Installing tools from tools.go | ||
- cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % env GOBIN=${BIN_DIR} go install % | ||
|
||
.PHONY: clean | ||
clean: ## run all cleanup tasks | ||
go clean ./... | ||
rm -rf $(BIN_DIR) | ||
rm -rf ./builds | ||
|
||
test: generate ## Run unit tests | ||
go test -count=1 -v ./... | ||
@echo "" | ||
@echo "${GREEN} All tests passed ✅" | ||
@echo "${RESET}" | ||
|
||
test-integration: ## Integration test | ||
test-integration: | ||
go test -timeout 300s -tags integration -v ./... | ||
@echo "" | ||
@echo "${GREEN} All tests passed ✅" | ||
@echo "${RESET}" | ||
|
||
lint: tools ## Run linter | ||
${BIN_DIR}/golangci-lint --color=always run ./... -v --timeout 15m | ||
|
||
generate: tools | ||
# Because go generate doesn't support subschell we need to call it directly | ||
- ./bin/moq -pkg consul -out ./mocks_grpc_test.go $$(go list -f '{{.Dir}}' google.golang.org/grpc/resolver) ClientConn | ||
- go generate -x ./... | ||
|
||
help: ## Display help screen | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / \ | ||
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: "3.8" | ||
services: | ||
consul: | ||
image: hashicorp/consul:1.13 | ||
ports: | ||
- "127.0.0.1:8500:8500" | ||
command: agent -ui -client 0.0.0.0 -dev | ||
|
Oops, something went wrong.