++ stand test entities

This commit is contained in:
Kochetkov S 2026-10-28 10:56:22 +03:00
parent a1d2db6bd7
commit 2f0f2e37c8
8 changed files with 77 additions and 3 deletions

View File

@ -40,8 +40,9 @@ def module_versions(platform_dir: Path) -> dict[str, str]:
return dict(re.findall(r'^\s*([a-z0-9-]+)\s*=\s*"([^"]+)"', block.group(1), re.M)) return dict(re.findall(r'^\s*([a-z0-9-]+)\s*=\s*"([^"]+)"', block.group(1), re.M))
def infrastructure_yaml(contour: str) -> str: def infrastructure_yaml(contour: str, env_block: str = "") -> str:
return f"current_environment: {contour}\nenvironments:\n {contour}: {{}}\n" body = "".join(f" {line}\n" if line else "\n" for line in env_block.splitlines()) if env_block.strip() else ""
return f"current_environment: {contour}\nenvironments:\n {contour}:" + ("\n" + body if body else " {}\n")
def git_env(token: str | None) -> dict: def git_env(token: str | None) -> dict:
@ -72,7 +73,8 @@ def collect(repo: Path, contour: str, source_base: str, token: str | None) -> tu
raise SliceError(f"missing {', '.join(missing)}") raise SliceError(f"missing {', '.join(missing)}")
if not any(p.startswith(f"environments/{contour}/") for p in files): if not any(p.startswith(f"environments/{contour}/") for p in files):
raise SliceError(f"no environments/{contour}") raise SliceError(f"no environments/{contour}")
files["infrastructure.yaml"] = infrastructure_yaml(contour).encode() env_block = files.pop(f"environments/{contour}/infrastructure.yaml", b"").decode()
files["infrastructure.yaml"] = infrastructure_yaml(contour, env_block).encode()
ref = code_ref(repo, contour) ref = code_ref(repo, contour)
pins = {"terraform-platform": ref} pins = {"terraform-platform": ref}
with tempfile.TemporaryDirectory() as tmp: with tempfile.TemporaryDirectory() as tmp:

View File

@ -15,3 +15,6 @@ backends:
kind: incluster kind: incluster
rabbitmq: rabbitmq:
cluster: default cluster: default
amqp_host: rabbitmq.rabbitmq.svc.cluster.local
amqp_port: 5672
management_endpoint: http://rabbitmq.rabbitmq.svc.cluster.local:15672

View File

@ -0,0 +1,16 @@
kafka_cluster_refs:
stand:
bootstrap_servers: kafka-kafka-contour.kafka.svc.cluster.local:9092
host: kafka-kafka-contour.kafka.svc.cluster.local
port: 9092
sasl_mechanism: SCRAM-SHA-512
security_protocol: SASL_SSL
tls_enabled: true
default_partitions: 3
default_replication_factor: 1
max_replication_factor: 1
kafka_policy:
allow_create: true
allow_delete: false
allow_partition_increase: true
allow_partition_decrease: false

View File

@ -6,3 +6,8 @@ namespaces:
services: services:
- camunda-identity - camunda-identity
- camunda-keycloak - camunda-keycloak
stand-test:
owner: stand-test
secret_prefix: service
services:
- stand-test

View File

@ -0,0 +1,27 @@
service: stand-test
owner: stand-test
needs:
postgresql:
database: stand_test_db
user: stand_test
s3:
buckets:
- name: stand-test
rabbitmq:
vhosts:
- stand-test
endpoints:
- kind: exchange
name: events
type: topic
- kind: queue
name: events
bindings:
- source: events
destination: events
routing_key: "#"
kafka:
topics:
- name: stand.test.event.v1
partitions: 3

View File

@ -0,0 +1,7 @@
include "root" {
path = "${get_env("PLATFORM_CODE_DIR", "")}/terragrunt/root.hcl"
}
include "unit" {
path = "${get_env("PLATFORM_CODE_DIR", "")}/terragrunt/units/kafka-topics.hcl"
}

View File

@ -0,0 +1,7 @@
include "root" {
path = "${get_env("PLATFORM_CODE_DIR", "")}/terragrunt/root.hcl"
}
include "unit" {
path = "${get_env("PLATFORM_CODE_DIR", "")}/terragrunt/units/rabbitmq.hcl"
}

View File

@ -0,0 +1,7 @@
include "root" {
path = "${get_env("PLATFORM_CODE_DIR", "")}/terragrunt/root.hcl"
}
include "unit" {
path = "${get_env("PLATFORM_CODE_DIR", "")}/terragrunt/units/s3.hcl"
}