{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.syn.build/deploy-engine/laravel-site/v1/schema.json",
  "title": "Laravel deployment binding v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "site",
    "environment",
    "archetype",
    "target",
    "compose_project",
    "proxy_alias",
    "container",
    "retention"
  ],
  "properties": {
    "schema": {
      "const": "https://schemas.syn.build/deploy-engine/laravel-site/v1"
    },
    "site": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$"
    },
    "environment": {
      "enum": [
        "tst",
        "prd"
      ]
    },
    "archetype": {
      "const": "laravel-site"
    },
    "target": {
      "type": "string",
      "pattern": "^/srv/apps/[a-z0-9-]+$"
    },
    "compose_project": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$"
    },
    "proxy_alias": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*$"
    },
    "container": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "env_prefix"
      ],
      "properties": {
        "env_prefix": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9_]*$"
        }
      }
    },
    "retention": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "prune_superseded_images"
      ],
      "properties": {
        "prune_superseded_images": {
          "type": "boolean"
        }
      }
    },
    "hooks": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "post_migrate": {
          "type": "string",
          "pattern": "^deploy/hooks/[a-z0-9-]+\\.sh$"
        },
        "post_rollout": {
          "type": "string",
          "pattern": "^deploy/hooks/[a-z0-9-]+\\.sh$"
        },
        "post_rollback": {
          "type": "string",
          "pattern": "^deploy/hooks/[a-z0-9-]+\\.sh$"
        }
      }
    }
  }
}