Skip to content

Commit

Permalink
fix error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aijeyomah committed Nov 3, 2024
1 parent 6e448a7 commit f687479
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 70 deletions.
91 changes: 21 additions & 70 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,85 +15,36 @@
# include build/Makefile.core.mk


# .PHONY: all
# all: dep-check build
# ## Lint check
# golangci: error dep-check
# golangci-lint run --exclude-use-default

# ## Analyze error codes
# error: dep-check
# go run github.com/layer5io/meshkit/cmd/errorutil -d . analyze -i ./build -o ./build

# ## Runs meshkit error utility to update error codes.
# error-util:
# go run github.com/layer5io/meshkit/cmd/errorutil -d . update -i ./build -o ./build
.PHONY: all
all: dep-check build
## Lint check
golangci: error dep-check
golangci-lint run --exclude-use-default

## Analyze error codes
error: dep-check
go run github.com/layer5io/meshkit/cmd/errorutil -d . analyze -i ./build -o ./build

## Runs meshkit error utility to update error codes.
error-util:
go run github.com/layer5io/meshkit/cmd/errorutil -d . update -i ./build -o ./build

# #-----------------------------------------------------------------------------
# # Dependencies
# #-----------------------------------------------------------------------------
# .PHONY: dep-check
# #.SILENT: dep-check

# INSTALLED_GO_VERSION=$(shell go version)

# dep-check:

# ifeq (,$(findstring $(GOVERSION), $(INSTALLED_GO_VERSION)))
# # Only send a warning.
# @echo "Dependency missing: go$(GOVERSION). Ensure 'go$(GOVERSION).x' is installed and available in your 'PATH'"
# @echo "GOVERSION: " $(GOVERSION)
# @echo "INSTALLED_GO_VERSION: " $(INSTALLED_GO_VERSION)
# endif


# OUTDIR := ./cmd/kanvas-snapshot/bin
# ARCH := amd64

# BINNAME_DARWIN ?= kanvas-snapshot-darwin-$(ARCH)
# BINNAME_LINUX ?= kanvas-snapshot-linux-$(ARCH)
# BINNAME_WINDOWS ?= kanvas-snapshot-windows-$(ARCH).exe


# LDFLAGS := "\
# -X 'main.providerToken=$(PROVIDER_TOKEN)' \
# -X 'main.MesheryCloudApiBaseUrl=$(MESHERY_CLOUD_API_BASE_URL)' \
# -X 'main.MesheryApiBaseUrl=$(MESHERY_API_BASE_URL)'"
# .PHONY: build
# build:
# @echo "Building for all platforms..."
# @$(MAKE) $(BINNAME_DARWIN)
# @$(MAKE) $(BINNAME_LINUX)
# @$(MAKE) $(BINNAME_WINDOWS)

# # Build Helm plugin for Darwin (macOS)
# .PHONY: $(BINNAME_DARWIN)
# $(BINNAME_DARWIN):
# @echo "Building for Darwin..."
# CGO_ENABLED=0 GOARCH=$(ARCH) GOOS=darwin go build -ldflags=$(LDFLAGS) -o $(OUTDIR)/$(BINNAME_DARWIN) ./cmd/kanvas-snapshot/main.go

# # Build Helm plugin for Linux
# .PHONY: $(BINNAME_LINUX)
# $(BINNAME_LINUX):
# @echo "Building for Linux..."
# CGO_ENABLED=0 GOARCH=$(ARCH) GOOS=linux go build -ldflags=$(LDFLAGS) -o $(OUTDIR)/$(BINNAME_LINUX) ./cmd/kanvas-snapshot/main.go

# # Build Helm plugin for Windows
# .PHONY: $(BINNAME_WINDOWS)
# $(BINNAME_WINDOWS):
# @echo "Building for Windows..."
# CGO_ENABLED=0 GOARCH=$(ARCH) GOOS=windows go build -ldflags=$(LDFLAGS) -o $(OUTDIR)/$(BINNAME_WINDOWS) ./cmd/kanvas-snapshot/main.go

# # Clean up binaries
# .PHONY: clean
# clean:
# @echo "Cleaning up..."
# rm -rf $(OUTDIR)
.PHONY: dep-check
#.SILENT: dep-check

INSTALLED_GO_VERSION=$(shell go version)

dep-check:

ifeq (,$(findstring $(GOVERSION), $(INSTALLED_GO_VERSION)))
# Only send a warning.
@echo "Dependency missing: go$(GOVERSION). Ensure 'go$(GOVERSION).x' is installed and available in your 'PATH'"
@echo "GOVERSION: " $(GOVERSION)
@echo "INSTALLED_GO_VERSION: " $(INSTALLED_GO_VERSION)
endif

GOFMT_FILES?=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
APP_NAME?=helm-kanvas-snapshot
Expand Down
5 changes: 5 additions & 0 deletions build/component_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "helm-kanvas-snapshot",
"type": "component",
"next_error_code": 1000
}
Binary file removed helm-kanvas-snapshot
Binary file not shown.

0 comments on commit f687479

Please sign in to comment.