docs: 完善开发与测试环境

This commit is contained in:
2026-09-09 20:18:15 +00:00
parent 0a14dded9d
commit 227994bc10
6 changed files with 229 additions and 5 deletions
+16
View File
@@ -16,6 +16,9 @@ endif
# tools. (i.e. podman)
CONTAINER_TOOL ?= docker
# DEV_COMPOSE manages disposable PostgreSQL and OpenBao dependencies for local work.
DEV_COMPOSE ?= docker compose -f hack/dev/compose.yaml
# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
@@ -43,6 +46,19 @@ help: ## Display this help.
##@ Development
.PHONY: dev-up
dev-up: ## Start disposable PostgreSQL and OpenBao development dependencies.
$(DEV_COMPOSE) up -d --wait
.PHONY: dev-smoke
dev-smoke: dev-up ## Verify PostgreSQL and OpenBao development dependencies.
$(DEV_COMPOSE) exec -T postgres psql -U postgres -d postgres -v ON_ERROR_STOP=1 -c 'SELECT 1'
$(DEV_COMPOSE) exec -T openbao sh -ec 'bao kv put secret/postgresql-admin username=postgres password=postgres-dev-only >/dev/null; test "$$(bao kv get -field=username secret/postgresql-admin)" = postgres'
.PHONY: dev-down
dev-down: ## Remove disposable development dependencies and their data.
$(DEV_COMPOSE) down --volumes --remove-orphans
.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
"$(CONTROLLER_GEN)" rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases