GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — stackrox-mcp/Makefile at main · stackrox/stackrox-mcp Expand file tree/ Copy pathMakefileMore file actions 227 lines (182 loc) · 6.99 KB / Copy pathMakefileFile metadata and controls227 lines (182 loc) · 6.99 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 # Default target .DEFAULT_GOAL := help # Binary name BINARY_NAME=stackrox-mcp # Version can be overridden with VERSION=x.y.z make build (default: extracted from git tags or use dev) VERSION?=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev") # Go parameters GOCMD=go GOBUILD=$(GOCMD) build GOTEST=$(GOCMD) test GOFMT=$(GOCMD) fmt GOCLEAN=$(GOCMD) clean # Set the container runtime command - prefer podman, fallback to docker DOCKER_CMD = $(shell command -v podman >/dev/null 2>&1 && echo podman || echo docker) # Branding can be overridden for Red Hat builds SERVER_NAME?=stackrox-mcp PRODUCT_DISPLAY_NAME?=StackRox # Build flags LDFLAGS=-ldflags "\ -X 'github.com/stackrox/stackrox-mcp/internal/config.version=$(VERSION)' \ -X 'github.com/stackrox/stackrox-mcp/internal/config.serverName=$(SERVER_NAME)' \ -X 'github.com/stackrox/stackrox-mcp/internal/config.productDisplayName=$(PRODUCT_DISPLAY_NAME)'" # Coverage files COVERAGE_OUT=coverage.out # JUnit files JUNIT_OUT=junit.xml # Lint files LINT_OUT=report.xml .PHONY: help help: ## Display this help message @echo "Available targets:" @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' .PHONY: build build: ## Build the binary $(GOBUILD) $(LDFLAGS) -o $(BINARY_NAME) ./cmd/stackrox-mcp .PHONY: image image: ## Build the docker image $(DOCKER_CMD) build \ --build-arg VERSION="$(VERSION)" \ --build-arg SERVER_NAME="$(SERVER_NAME)" \ --build-arg PRODUCT_DISPLAY_NAME="$(PRODUCT_DISPLAY_NAME)" \ -t quay.io/stackrox-io/mcp:$(VERSION) \ . .PHONY: dockerfile-lint dockerfile-lint: ## Run hadolint for Dockerfile $(DOCKER_CMD) run --rm -i --env HADOLINT_FAILURE_THRESHOLD=info ghcr.io/hadolint/hadolint < Dockerfile $(DOCKER_CMD) run --rm -i --env HADOLINT_FAILURE_THRESHOLD=info ghcr.io/hadolint/hadolint < konflux.Dockerfile .PHONY: helm-lint helm-lint: ## Run helm lint for Helm chart helm lint charts/stackrox-mcp .PHONY: test test: ## Run unit tests $(GOTEST) -v ./... .PHONY: e2e-smoke-test e2e-smoke-test: ## Run E2E smoke test (build and verify mcpchecker) @cd e2e-tests && ./scripts/smoke-test.sh .PHONY: e2e-test mock-start proto-generate e2e-test: ## Run E2E tests (uses WireMock) @cd e2e-tests && ./scripts/run-tests.sh .PHONY: test-coverage-and-junit test-coverage-and-junit: ## Run unit tests with coverage and junit output go install github.com/jstemmer/go-junit-report/[email protected] $(GOTEST) -v -cover -race -coverprofile=$(COVERAGE_OUT) -tags=!smoke ./... 2>&1 | go-junit-report -set-exit-code -iocopy -out $(JUNIT_OUT) .PHONY: test-integration-coverage test-integration-coverage: ## Run integration tests with coverage $(GOTEST) -v -cover -race -tags=integration -coverprofile=coverage-integration.out ./integration .PHONY: coverage-html coverage-html: test ## Generate and open HTML coverage report $(GOCMD) tool cover -html=$(COVERAGE_OUT) .PHONY: fmt fmt: ## Format Go code $(GOFMT) ./... .PHONY: fmt-check fmt-check: ## Check if Go code is formatted (fails if not) @if [ -n "$$(gofmt -l .)" ]; then \ echo "The following files are not formatted:"; \ gofmt -l .; \ exit 1; \ fi .PHONY: lint lint: ## Run golangci-lint go install -v "github.com/golangci/golangci-lint/v2/cmd/[email protected]" golangci-lint run .PHONY: shell-lint shell-lint: ## Run shellcheck on shell scripts @echo "Running shellcheck..." @shellcheck scripts/*.sh e2e-tests/scripts/*.sh .PHONY: renovate-validate renovate-validate: ## Validate .github/renovate.json5 configuration # Using MintMaker's Renovate image instead of the standard renovate/renovate because it includes # the rpm-lockfile manager which is a MintMaker-specific extension unknown to the standard image. $(DOCKER_CMD) run --rm -it --entrypoint=renovate-config-validator -v "$(shell pwd)/.github":/mnt_github -w /mnt_github quay.io/konflux-ci/mintmaker-renovate-image:latest --strict .PHONY: actionlint actionlint: ## Run actionlint on GitHub Actions workflows @echo "Running actionlint..." @cd e2e-tests/tools && go build -o ../../bin/actionlint actionlint.kjanat.dev/cmd/actionlint @./bin/actionlint -color ############## ## Protobuf ## ############## # Protoc version and paths PROTOC_VERSION := 32.1 UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) PROTOC_OS = linux endif ifeq ($(UNAME_S),Darwin) PROTOC_OS = osx endif PROTOC_ARCH=$(shell case $$(uname -m) in (arm64|aarch64) echo aarch_64 ;; (s390x) echo s390_64 ;; (*) uname -m ;; esac) PROTO_PRIVATE_DIR := .proto PROTOC_DIR := $(PROTO_PRIVATE_DIR)/protoc-$(PROTOC_OS)-$(PROTOC_ARCH)-$(PROTOC_VERSION) PROTOC := $(PROTOC_DIR)/bin/protoc PROTOC_ZIP := protoc-$(PROTOC_VERSION)-$(PROTOC_OS)-$(PROTOC_ARCH).zip PROTOC_DOWNLOADS_DIR := $(PROTO_PRIVATE_DIR)/.downloads PROTOC_FILE := $(PROTOC_DOWNLOADS_DIR)/$(PROTOC_ZIP) $(PROTOC_DOWNLOADS_DIR): @mkdir -p "$@" $(PROTOC_FILE): $(PROTOC_DOWNLOADS_DIR) @echo "Downloading protoc $(PROTOC_VERSION)..." @curl -fSL -o "$@" "https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/$(PROTOC_ZIP)" $(PROTOC): $(PROTOC_FILE) @echo "Installing protoc to $(PROTOC_DIR)..." @mkdir -p "$(PROTOC_DIR)" @unzip -q -o -d "$(PROTOC_DIR)" "$(PROTOC_FILE)" @test -x "$@" @echo "✓ protoc $(PROTOC_VERSION) installed" .PHONY: proto-install proto-install: $(PROTOC) ## Install protoc locally .PHONY: proto-setup proto-setup: ## Setup proto files from go mod cache @./scripts/setup-proto-files.sh .PHONY: proto-generate proto-generate: $(PROTOC) ## Generate proto descriptors for WireMock @PROTOC_BIN=$(PROTOC) ./scripts/generate-proto-descriptors.sh .PHONY: proto-clean proto-clean: ## Clean generated proto files @rm -rf wiremock/proto/ wiremock/grpc/ .PHONY: proto-check proto-check: ## Verify proto setup is correct @if [ ! -f wiremock/proto/descriptors/stackrox.dsc ]; then \ echo "❌ Proto descriptors not found"; \ echo "Run: make proto-generate"; \ exit 1; \ fi @echo "✓ Proto descriptors present" .PHONY: mock-download mock-download: ## Download WireMock JARs @./scripts/download-wiremock.sh .PHONY: mock-start mock-start: proto-check ## Start WireMock mock Central locally @./scripts/start-mock-central.sh .PHONY: mock-stop mock-stop: ## Stop WireMock mock Central @./scripts/stop-mock-central.sh .PHONY: mock-logs mock-logs: ## View WireMock logs @tail -f wiremock/wiremock.log .PHONY: mock-restart mock-restart: mock-stop mock-start ## Restart WireMock .PHONY: mock-status mock-status: ## Check WireMock status @if [ -f wiremock/wiremock.pid ]; then \ PID=$$(cat wiremock/wiremock.pid); \ if ps -p $$PID > /dev/null 2>&1; then \ echo "WireMock is running (PID: $$PID)"; \ else \ echo "WireMock PID file exists but process not running"; \ fi \ else \ echo "WireMock is not running"; \ fi .PHONY: mock-test mock-test: proto-generate mock-download ## Run WireMock smoke tests @./scripts/smoke-test-wiremock.sh .PHONY: clean clean: ## Clean build artifacts and coverage files $(GOCLEAN) rm -f $(BINARY_NAME) rm -f $(COVERAGE_OUT) rm -f $(LINT_OUT) rm -rf $(PROTO_PRIVATE_DIR) |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |