-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from OpenCHAMI/refactor
Refactor and clean up code base
- Loading branch information
Showing
35 changed files
with
1,362 additions
and
1,448 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,3 +1,4 @@ | ||
magellan | ||
emulator/rf-emulator | ||
**/*.db | ||
dist/* |
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 |
---|---|---|
|
@@ -13,11 +13,12 @@ $(error VERSION is not set. Please review and copy config.env.default to config | |
endif | ||
|
||
SHELL := /bin/bash | ||
GOPATH ?= $(shell echo $${GOPATH:-~/go}) | ||
|
||
.DEFAULT_GOAL := all | ||
.PHONY: all | ||
all: ## build pipeline | ||
all: mod inst build spell lint test | ||
all: mod inst build lint test | ||
|
||
.PHONY: ci | ||
ci: ## CI build pipeline | ||
|
@@ -47,27 +48,30 @@ inst: ## go install tools | |
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
go install github.com/goreleaser/[email protected] | ||
|
||
.PHONY: goreleaser | ||
release: ## goreleaser build | ||
$(call print-target) | ||
$(GOPATH)/bin/goreleaser build --clean --single-target --snapshot | ||
|
||
.PHONY: build | ||
build: ## goreleaser build | ||
build: | ||
$(call print-target) | ||
goreleaser build --clean --single-target --snapshot | ||
go build --tags=all | ||
|
||
.PHONY: docker | ||
docker: ## docker build | ||
docker: | ||
container: ## docker build | ||
container: | ||
$(call print-target) | ||
docker build . --build-arg REGISTRY_HOST=${REGISTRY_HOST} --no-cache --pull --tag '${NAME}:${VERSION}' | ||
|
||
.PHONY: spell | ||
spell: ## misspell | ||
$(call print-target) | ||
misspell -error -locale=US -w **.md | ||
$(GOPATH)/bin/misspell -error -locale=US -w **.md | ||
|
||
.PHONY: lint | ||
lint: ## golangci-lint | ||
$(call print-target) | ||
golangci-lint run --fix | ||
$(GOPATH)/bin/golangci-lint run --fix | ||
|
||
.PHONY: test | ||
test: ## go test | ||
|
@@ -88,6 +92,11 @@ docs: ## go docs | |
go doc github.com/OpenCHAMI/magellan/internal | ||
go doc github.com/OpenCHAMI/magellan/pkg/crawler | ||
|
||
.PHONY: emulator | ||
emulator: | ||
$(call print-target) | ||
./emulator/setup.sh | ||
|
||
define print-target | ||
@printf "Executing target: \033[36m$@\033[0m\n" | ||
endef |
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
Oops, something went wrong.