@@ -5,6 +5,9 @@ PLUGIN_NAME ?=monitoring-plugin
55IMAGE ?= quay.io/${ORG}/${PLUGIN_NAME}:${VERSION}
66FEATURES ?=incidents,perses-dashboards,dev-config
77
8+ GOLANGCI_LINT = $(shell pwd) /_output/tools/bin/golangci-lint
9+ GOLANGCI_LINT_VERSION ?= v2.11.3
10+
811export NODE_OPTIONS?=--max_old_space_size =4096
912
1013.PHONY : install-frontend
@@ -39,12 +42,6 @@ i18n-frontend:
3942lint-frontend :
4043 cd web && npm run lint
4144
42- .PHONY : lint-backend
43- lint-backend :
44- go mod tidy
45- go fmt ./cmd/
46- go fmt ./pkg/
47-
4845.PHONY : install-backend
4946install-backend :
5047 go mod download
@@ -69,7 +66,6 @@ test-frontend:
6966build-image :
7067 ./scripts/build-image.sh
7168
72-
7369.PHONY : install
7470install :
7571 make install-frontend && make install-backend
@@ -79,8 +75,7 @@ update-plugin-name:
7975 ./scripts/update-plugin-name.sh
8076
8177.PHONY : deploy
82- deploy :
83- make lint-backend
78+ deploy : lint-backend
8479 PUSH=1 scripts/build-image.sh
8580 helm uninstall $(PLUGIN_NAME ) -n $(PLUGIN_NAME ) -ns || true
8681 helm install $(PLUGIN_NAME ) charts/openshift-console-plugin -n monitoring-plugin-ns --create-namespace --set plugin.image=$(IMAGE )
@@ -89,6 +84,19 @@ deploy:
8984deploy-acm :
9085 ./scripts/deploy-acm.sh
9186
87+ # Download and install golangci-lint if not already installed
88+ .PHONY : golangci-lint
89+ golangci-lint :
90+ @[ -f $( GOLANGCI_LINT) ] || { \
91+ set -e ; \
92+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT ) ) $(GOLANGCI_LINT_VERSION ) ; \
93+ }
94+
95+ .PHONY : lint-backend
96+ lint-backend : golangci-lint
97+ go mod tidy
98+ $(GOLANGCI_LINT ) -c $(shell pwd) /.golangci-lint.yaml run --verbose
99+
92100.PHONY : build-mcp-image
93101build-mcp-image :
94102 DOCKER_FILE_NAME=" Dockerfile.mcp" REPO=" monitoring-console-plugin" scripts/build-image.sh
0 commit comments