mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-12-03 16:01:34 +03:00
++ stand test entities
This commit is contained in:
parent
a1d2db6bd7
commit
2f0f2e37c8
@ -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))
|
||||
|
||||
|
||||
def infrastructure_yaml(contour: str) -> str:
|
||||
return f"current_environment: {contour}\nenvironments:\n {contour}: {{}}\n"
|
||||
def infrastructure_yaml(contour: str, env_block: str = "") -> str:
|
||||
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:
|
||||
@ -72,7 +73,8 @@ def collect(repo: Path, contour: str, source_base: str, token: str | None) -> tu
|
||||
raise SliceError(f"missing {', '.join(missing)}")
|
||||
if not any(p.startswith(f"environments/{contour}/") for p in files):
|
||||
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)
|
||||
pins = {"terraform-platform": ref}
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
|
||||
@ -15,3 +15,6 @@ backends:
|
||||
kind: incluster
|
||||
rabbitmq:
|
||||
cluster: default
|
||||
amqp_host: rabbitmq.rabbitmq.svc.cluster.local
|
||||
amqp_port: 5672
|
||||
management_endpoint: http://rabbitmq.rabbitmq.svc.cluster.local:15672
|
||||
|
||||
16
environments/stand/infrastructure.yaml
Normal file
16
environments/stand/infrastructure.yaml
Normal 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
|
||||
@ -6,3 +6,8 @@ namespaces:
|
||||
services:
|
||||
- camunda-identity
|
||||
- camunda-keycloak
|
||||
stand-test:
|
||||
owner: stand-test
|
||||
secret_prefix: service
|
||||
services:
|
||||
- stand-test
|
||||
|
||||
27
environments/stand/services/stand-test.yaml
Normal file
27
environments/stand/services/stand-test.yaml
Normal 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
|
||||
7
live-contract/stand/kafka-topics/terragrunt.hcl
Normal file
7
live-contract/stand/kafka-topics/terragrunt.hcl
Normal 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"
|
||||
}
|
||||
7
live-contract/stand/rabbitmq/terragrunt.hcl
Normal file
7
live-contract/stand/rabbitmq/terragrunt.hcl
Normal 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"
|
||||
}
|
||||
7
live-contract/stand/s3/terragrunt.hcl
Normal file
7
live-contract/stand/s3/terragrunt.hcl
Normal 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"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user