Schema/navgit.schema.json

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "navgit.schema.json",
  "title": "NAVGit repository configuration (navgit.json)",
  "description": "Per-repository configuration for NAVGit. Supports Dynamics NAV 2016 (9.0) through Business Central 14 (C/AL).",
  "type": "object",
  "additionalProperties": false,
  "required": ["projectName", "artifact"],
  "properties": {
    "$schema": { "type": "string" },
    "projectName": {
      "type": "string",
      "minLength": 1,
      "description": "Project name. Used for the default container name and the backup folder search."
    },
    "containerName": {
      "description": "Docker container name (max 15 characters, letters, digits and '-'): a name, { \"fixed\": name } or { \"branch\": { \"prefix\": key, \"length\": n } } (first n characters of a ticket branch such as MIS-1234-text, else the default). containerName in the user settings wins. Default: projectName with '_' replaced by '-', truncated to 15 characters.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,14}$"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["fixed"],
          "properties": {
            "fixed": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9-]{0,14}$",
              "description": "Always use this container name."
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["branch"],
          "properties": {
            "branch": {
              "type": "object",
              "additionalProperties": false,
              "required": ["length"],
              "properties": {
                "prefix": {
                  "type": "string",
                  "pattern": "^([A-Za-z][A-Za-z0-9]*-?)?$",
                  "description": "Issue key the branch must start with, followed by '-' and a number, e.g. 'MIS' matches MIS-1234-text but not MISC-1234 or OPS-1234 (case-insensitive). Default: any upper case issue key."
                },
                "length": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 15,
                  "description": "Number of leading characters of the branch name to use, e.g. 8 turns MIS-1234-fix-posting into MIS-1234. Branches that do not start with a ticket key (prefix-number, e.g. MIS-1234) use the next containerName (user settings, then navgit.json, then the default)."
                }
              }
            }
          }
        }
      ]
    },
    "navRelease": {
      "type": "string",
      "description": "Overrides the release name used in backup file names (default: 2016, 2017, 2018, 2019 for BC13, BC14 for BC14)."
    },
    "artifact": {
      "description": "Which Docker artifact to use. Use exactly one form: an explicit url, a NAV release (nav + optional cu), or a version prefix.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["url"],
          "properties": {
            "url": { "type": "string", "pattern": "^https://", "description": "Explicit artifact URL, e.g. https://bcartifacts.../onprem/11.0.48560.0/no" }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["nav"],
          "properties": {
            "nav": { "type": "string", "enum": ["2016", "2017", "2018"], "description": "NAV release (resolved with Get-NavArtifactUrl)." },
            "cu": { "type": "string", "pattern": "^([Rr][Tt][Mm]|[Cc][Uu][0-9]+)$", "description": "Cumulative update, e.g. rtm or cu30. Default: latest." },
            "country": { "type": "string", "description": "Localization, e.g. w1, no, dk. Default: w1." }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["version"],
          "properties": {
            "type": { "type": "string", "enum": ["OnPrem"], "description": "Artifact type. Only OnPrem is meaningful for C/AL." },
            "version": { "type": "string", "pattern": "^(9|1[0-4])(\\.[0-9]+){0,3}$", "description": "Version prefix between 9 and 14, e.g. 14, 14.0 or 14.0.29537.0 (resolved with Get-BcArtifactUrl)." },
            "country": { "type": "string", "description": "Localization, e.g. w1, no, dk. Default: w1." },
            "select": { "type": "string", "enum": ["Latest", "First", "Closest"], "description": "Which matching artifact to pick. Closest requires a full four-part version. Default: Latest." }
          }
        }
      ]
    },
    "imageName": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]*$",
      "default": "navgit",
      "description": "Local image name used by BcContainerHelper. Combined with a backup file this builds a cached image without the Cronus database (-nodb)."
    },
    "database": {
      "type": "object",
      "additionalProperties": false,
      "description": "Which database the container starts with.",
      "properties": {
        "bakFile": { "type": "string", "description": "Backup file: absolute path, path relative to the repository or the user backupFolder, or an http(s) URL. Passed to New-BcContainer -bakFile." },
        "useDemo": { "type": "boolean", "default": false, "description": "Use the Cronus demo database from the artifact instead of a backup." },
        "searchNames": { "type": "array", "items": { "type": "string" }, "default": [], "description": "Extra names to try (after projectName) when searching the user backupFolder." }
      }
    },
    "licenseFile": {
      "type": "string",
      "description": "License file: absolute path, path relative to the repository or the user licenseFolder, or an http(s) URL. '{major}' is replaced with the major version."
    },
    "auth": {
      "type": "string",
      "enum": ["Windows", "NavUserPassword"],
      "description": "Container authentication. Default: NavUserPassword on Azure AD joined machines and Windows elsewhere. auth in the user settings wins."
    },
    "isolation": {
      "type": "string",
      "enum": ["", "hyperv", "process"],
      "description": "Container isolation (New-BcContainer -isolation). Empty lets BcContainerHelper choose. Default: empty. isolation in the user settings wins."
    },
    "memoryLimit": {
      "type": "string",
      "pattern": "^([0-9]+(\\.[0-9]+)?[MmGg])?$",
      "default": "",
      "description": "Container memory limit, e.g. 8G. Empty uses the BcContainerHelper default (8G for hyperv)."
    },
    "dns": { "type": "string", "default": "", "description": "DNS server for the container, or 'hostDNS'. Empty uses the Docker default." },
    "updateHosts": { "type": "boolean", "default": true, "description": "Add the container to the hosts file so it can be reached by name." },
    "shortcuts": {
      "type": "string",
      "enum": ["None", "Desktop", "StartMenu", "CommonStartMenu", "CommonDesktop", "DesktopFolder", "CommonDesktopFolder"],
      "default": "None",
      "description": "Where BcContainerHelper creates the container's shortcuts (New-BcContainer -shortcuts). Default: None. shortcuts in the user settings wins."
    },
    "enableSymbolLoading": { "type": "boolean", "default": false, "description": "Enable symbol loading (NAV 2018 / BC14 only, versions 11-14)." },
    "includeTestToolkit": { "type": "boolean", "default": false, "description": "Import the test toolkit while creating the container." },
    "testToolkit": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "country": { "type": "string", "default": "", "description": "Test toolkit country (Import-TestToolkitToBcContainer -testToolkitCountry)." },
        "librariesOnly": { "type": "boolean", "default": false, "description": "Import only the test libraries." }
      }
    },
    "myScripts": { "type": "array", "items": { "type": "string" }, "default": [], "description": "Scripts passed to New-BcContainer -myScripts (URLs or paths)." },
    "additionalParameters": {
      "type": "array",
      "items": { "type": "string" },
      "default": [],
      "description": "Extra docker run parameters. Settings that have their own entry (bakfile, licensefile, credentials, database, artifactUrl) are rejected here."
    },
    "paths": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "objects": { "type": "string", "minLength": 1, "default": "Objects", "description": "Folder (relative to the repository) for application objects." },
        "tests": { "type": "string", "minLength": 1, "default": "Tests", "description": "Folder (relative to the repository) for test objects." },
        "addIns": { "type": "string", "default": "Add-Ins", "description": "Folder (relative to the repository) with .NET add-ins. When it exists it is mapped to c:\\run\\Add-ins in the container and copied to the service tier and Windows client Add-ins folders. Empty disables it." }
      }
    },
    "testObjects": {
      "type": "object",
      "additionalProperties": false,
      "description": "How exported objects are recognised as test objects.",
      "properties": {
        "versionListPattern": { "type": "string", "default": "(^|,)\\s*Test", "description": "Case-insensitive regular expression matched against the Version List." },
        "includeTestCodeunits": { "type": "boolean", "default": true, "description": "Also treat codeunits with Subtype=Test as test objects." }
      }
    },
    "import": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "deleteMissing": { "type": "string", "enum": ["skip", "warn", "mark"], "default": "skip", "description": "Objects in the database but not in Git (usually outside the license range): 'skip' only writes a count to the verbose output, 'warn' lists them, 'mark' sets their Version List to #DELETE and lists them. A deleteMissing in the user settings overrides this." },
        "syncSchema": { "type": "string", "enum": ["Force", "Yes", "No"], "default": "Force", "description": "SynchronizeSchemaChanges used for import and compile." },
        "compileFilter": { "type": "string", "minLength": 1, "default": "Compiled=0", "description": "C/SIDE filter for objects compiled after import." },
        "dateFormat": { "type": "string", "default": "", "description": "Format of Date in the object files, e.g. 'dd.MM.yy' or 'MM/dd/yy'. Empty: derived from the separator ('.' dd.MM.yy, '-' dd-MM-yy, '/' MM/dd/yy). Only used to detect changed objects." }
      }
    },
    "export": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "filter": { "type": "string", "default": "", "description": "C/SIDE filter for objects exported to Git, e.g. 'Type=Table;Id=50000..50099'. Empty exports all objects (as AdvaniaGIT did); only then are object files of deleted objects removed from Git." },
        "format": { "type": "string", "enum": ["txt folder"], "default": "txt folder", "description": "Export format." }
      }
    },
    "client": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "defaultProfile": { "type": "string", "default": "", "description": "Profile ID used by 'Start NAV Client (default)'. Empty opens the default role center." }
      }
    },
    "showBcContainerCommand": {
      "type": "boolean",
      "default": false,
      "description": "Write the full New-BcContainer command (credential hidden) to the output before a container is built. Default: false. showBcContainerCommand in the user settings wins."
    }
  }
}