{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/xraph/forge/main/schema/forge-deploy.schema.json", "title": "Forge deployment configuration v2", "$ref": "#/$defs/Deploy", "$defs": { "Deploy": { "type": "object", "additionalProperties": false, "properties": { "version": { "type": "integer", "const": 2 }, "registry": { "type": "string" }, "defaults": { "$ref": "#/$defs/Defaults" }, "spec": { "type": "string" }, "environment_files": { "type": "object", "additionalProperties": { "type": "string" } }, "services": { "type": "object", "additionalProperties": { "$ref": "#/$defs/Service" } }, "resources": { "type": "object", "additionalProperties": { "$ref": "#/$defs/Resource" } }, "connections": { "type": "array", "items": { "$ref": "#/$defs/Connection" } }, "environments": { "type": "object", "additionalProperties": { "$ref": "#/$defs/Environment" } }, "targets": { "type": "object", "additionalProperties": { "$ref": "#/$defs/Target" } }, "secrets": { "$ref": "#/$defs/Secrets" }, "workbench": { "$ref": "#/$defs/Workbench" } }, "required": [ "version" ] }, "Defaults": { "type": "object", "additionalProperties": false, "properties": { "target": { "type": "string" }, "environment": { "type": "string" } } }, "Service": { "type": "object", "additionalProperties": false, "properties": { "app": { "type": "string" }, "kind": { "type": "string", "enum": [ "web", "worker", "job", "cron", "gateway" ] }, "ports": { "type": "object", "additionalProperties": { "$ref": "#/$defs/Port" } }, "health": { "$ref": "#/$defs/Health" }, "config": { "type": "array", "items": { "type": "string" } }, "replicas": { "type": "integer", "minimum": 1 }, "resources": { "$ref": "#/$defs/ResourceSpec" }, "bindings": { "type": "array", "items": { "$ref": "#/$defs/Binding" } }, "calls": { "type": "array", "items": { "type": "string" } }, "env": { "type": "object", "additionalProperties": { "type": "string" } }, "migrate": { "type": "string", "description": "\"\", \"auto\", or a command string" }, "discovery": { "type": "boolean" }, "schedule": { "type": "string" } }, "required": [ "app", "kind" ] }, "Port": { "type": "object", "additionalProperties": false, "properties": { "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "protocol": { "type": "string", "description": "\"http\" default, \"grpc\", \"tcp\"", "enum": [ "http", "grpc", "tcp" ] }, "exposure": { "type": "string", "enum": [ "public", "private" ], "description": "private default" } }, "required": [ "port" ] }, "Health": { "type": "object", "additionalProperties": false, "properties": { "readiness": { "type": "string" }, "liveness": { "type": "string" }, "startup": { "type": "string" }, "heartbeat": { "type": "boolean" }, "none": { "type": "boolean" } } }, "ResourceSpec": { "type": "object", "additionalProperties": false, "properties": { "cpu": { "type": "string" }, "memory": { "type": "string" }, "cpu_limit": { "type": "string" }, "memory_limit": { "type": "string" } } }, "Binding": { "type": "object", "additionalProperties": false, "properties": { "resource": { "type": "string" }, "extension": { "type": "string" }, "database": { "type": "string", "description": "grove" }, "store": { "type": "string", "description": "trove, grove_kv" }, "metadata_database": { "type": "string", "description": "trove" } }, "required": [ "resource", "extension" ] }, "Resource": { "type": "object", "additionalProperties": false, "properties": { "type": { "type": "string" }, "version": { "type": "string" }, "features": { "type": "array", "items": { "type": "string" } }, "bucket": { "type": "string" } }, "required": [ "type" ] }, "Connection": { "type": "object", "additionalProperties": false, "properties": { "from": { "type": "string" }, "to": { "type": "string" }, "port": { "type": "string", "description": "\"http\" default" }, "config_key": { "type": "string", "description": "\"services..url\" default" }, "timeout": { "type": "string", "pattern": "^(0|([0-9]+(\\.[0-9]+)?(ns|us|\u00b5s|ms|s|m|h))+)$" }, "retry": { "$ref": "#/$defs/Retry" } }, "required": [ "from", "to" ] }, "Retry": { "type": "object", "additionalProperties": false, "properties": { "attempts": { "type": "integer", "minimum": 0, "maximum": 5 } } }, "Environment": { "type": "object", "additionalProperties": false, "properties": { "target": { "type": "string" }, "replicas": { "type": "object", "additionalProperties": { "type": "integer" } }, "resources": { "type": "object", "additionalProperties": { "$ref": "#/$defs/ResourceOverride" } }, "env": { "type": "object", "additionalProperties": { "type": "string" } }, "ingress": { "$ref": "#/$defs/Ingress" }, "backup": { "$ref": "#/$defs/Backup" }, "services": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }, "purpose": { "enum": [ "development", "staging", "production" ] }, "environment_action": { "enum": [ "existing", "create" ] }, "external_services": { "type": "object", "additionalProperties": { "$ref": "#/$defs/ExternalService" } }, "health_overrides": { "type": "object", "additionalProperties": { "$ref": "#/$defs/Health" } }, "binding_overrides": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/$defs/Binding" } } } }, "required": [ "target" ] }, "ResourceOverride": { "type": "object", "additionalProperties": false, "properties": { "lifecycle": { "type": "string", "enum": [ "container", "external", "managed" ] }, "secret": { "type": "string" }, "recipe": { "type": "string" }, "remove": { "type": "boolean" }, "target": { "type": "string" } } }, "Ingress": { "type": "object", "additionalProperties": false, "properties": { "host": { "type": "string" }, "tls": { "type": "string", "description": "issuer name, \"letsencrypt\" by convention" } } }, "Backup": { "type": "object", "additionalProperties": false, "properties": { "schedule": { "type": "string" }, "destination": { "type": "string" }, "retention": { "type": "string" } } }, "Target": { "type": "object", "additionalProperties": true, "properties": { "provider": { "type": "string" }, "context": { "type": "string" }, "namespace": { "type": "string" }, "region": { "type": "string" }, "ingress_class": { "type": "string" }, "gateway_api": { "type": "boolean" }, "network_policy": { "type": "boolean" }, "project": { "type": "string", "description": "compose project name" }, "docker_context": { "type": "string" }, "observability": { "$ref": "#/$defs/Observability" }, "build": { "$ref": "#/$defs/Build" }, "release": { "$ref": "#/$defs/Release" }, "resource_only": { "type": "boolean" }, "local_cluster": { "type": "string" }, "storage_class": { "type": "string" }, "storage_size": { "type": "string" }, "ingress_namespace": { "type": "string" }, "gateway": { "type": "string" }, "external_cidrs": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "api_server_cidrs": { "type": "array", "items": { "type": "string" } }, "managed_databases": { "type": "object", "additionalProperties": { "type": "string" } }, "secret_keys": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Hosted secret reference names mapped to existing vault keys." } }, "required": [ "provider" ] }, "Observability": { "type": "object", "additionalProperties": false, "description": "Kubernetes only. OTLP export settings injected as OTEL_* variables, and a Prometheus Operator ServiceMonitor.", "properties": { "otlp_endpoint": { "type": "string", "description": "OTLP/HTTP base URL, injected as OTEL_EXPORTER_OTLP_ENDPOINT" }, "sampler": { "type": "string", "enum": [ "always_on", "always_off", "traceidratio", "parentbased_always_on", "parentbased_always_off", "parentbased_traceidratio" ] }, "sample_ratio": { "type": "number", "minimum": 0, "maximum": 1 }, "otlp_namespace": { "type": "string", "description": "namespace the collector runs in, for network_policy egress" }, "service_monitor": { "$ref": "#/$defs/ServiceMonitor" } } }, "ServiceMonitor": { "type": "object", "additionalProperties": false, "properties": { "enabled": { "type": "boolean" }, "interval": { "type": "string", "description": "scrape interval, 30s by default" }, "labels": { "type": "object", "additionalProperties": { "type": "string" }, "description": "labels your Prometheus selects ServiceMonitors by" }, "namespace": { "type": "string", "description": "namespace Prometheus runs in, for network_policy ingress" } } }, "Secrets": { "type": "object", "additionalProperties": false, "properties": { "resolver": { "type": "string", "description": "\"env\" default, \"file\", \"kubernetes\"", "enum": [ "env", "file", "kubernetes" ] }, "file": { "type": "string", "description": "\".forge/secrets.env\" default" }, "references": { "type": "object", "additionalProperties": { "type": "string" } } } }, "Build": { "type": "object", "additionalProperties": false, "properties": { "source": { "enum": [ "local", "remote", "ci", "existing", "git" ] }, "delivery": { "enum": [ "local", "registry" ] }, "platforms": { "type": "array", "items": { "type": "string" } }, "builder": { "type": "string" }, "registry": { "$ref": "#/$defs/Registry" }, "images": { "type": "object", "additionalProperties": { "type": "string" } }, "repo": { "type": "string" }, "branch": { "type": "string" }, "commit": { "type": "string" }, "trigger": { "enum": [ "off", "checksPass", "commit" ] }, "config_path": { "type": "string" }, "services": { "type": "object", "additionalProperties": { "$ref": "#/$defs/ServiceBuild" } } } }, "Registry": { "type": "object", "additionalProperties": false, "properties": { "host": { "type": "string" }, "namespace": { "type": "string" }, "auth": { "type": "string" }, "visibility": { "type": "string" }, "secret_ref": { "type": "string" }, "username": { "type": "string" }, "pull_secret": { "type": "string" } } }, "ServiceBuild": { "type": "object", "additionalProperties": false, "properties": { "root_dir": { "type": "string" }, "dockerfile": { "type": "string" }, "build_command": { "type": "string" }, "start_command": { "type": "string" } } }, "Release": { "type": "object", "additionalProperties": false, "properties": { "mode": { "enum": [ "direct", "gitops" ] }, "repo": { "type": "string" }, "branch": { "type": "string" }, "path": { "type": "string" }, "approval": { "type": "string" }, "controller": { "type": "string" } } }, "ExternalService": { "type": "object", "additionalProperties": false, "properties": { "url": { "type": "string" }, "auth": { "type": "string" } } }, "Workbench": { "type": "object", "additionalProperties": false, "properties": { "persistence": { "$ref": "#/$defs/Persistence" } } }, "Persistence": { "type": "object", "additionalProperties": false, "properties": { "backend": { "enum": [ "files", "sqlite", "postgres" ] }, "reference": { "type": "string" } } } } }