{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/deployed.json",
  "additionalProperties": false,
  "definitions": {
    "privateKey": {
      "description": "Buffer or string that contains a private key for either key-based or hostbased user authentication (OpenSSH format).",
      "type": ["string", "object"]
    },
    "passphrase": {
      "description": "For an encrypted privateKey, this is the passphrase used to decrypt it.",
      "type": "string",
      "minLength": 1
    },
    "script": {
      "description": "Execute script commands.",
      "type": "string",
      "minLength": 1
    },
    "backupName": {
      "description": "Old version backup name.",
      "type": "string",
      "minLength": 1
    },
    "removeLocalDir": {
      "description": "Delete localpath after deployment.",
      "type": "boolean"
    },
    "clearRemoteDir": {
      "description": "Empty the old version before deploying the new version.",
      "type": "boolean"
    }
  },
  "description": "JSON schema for the deployed cli config file. \n\nSee also: https://hyhello.github.io/deployed\n\n",
  "properties": {
    "$schema": {
      "description": "JSON Schema for deployed.",
      "type": "string",
      "minLength": 1
    },
    "projectName": {
      "description": "Name of project to be released.",
      "type": "string",
      "minLength": 1
    },
    "cluster": {
      "type": "array",
      "uniqueItems": true,
      "description": "Alias collection of environment to be deployed.",
      "items": {
        "type": "string"
      }
    },
    "privateKey": {
      "$ref": "#/definitions/privateKey"
    },
    "passphrase": {
      "$ref": "#/definitions/passphrase"
    },
    "script": {
      "$ref": "#/definitions/script"
    },
    "backupName": {
      "$ref": "#/definitions/backupName"
    },
    "removeLocalDir": {
      "$ref": "#/definitions/removeLocalDir"
    },
    "clearRemoteDir": {
      "$ref": "#/definitions/clearRemoteDir"
    },
    "modeList": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "required": [
          "mode",
          "name",
          "host",
          "port",
          "username",
          "localPath",
          "remotePath"
        ],
        "additionalProperties": false,
        "properties": {
          "mode": {
            "description": "Deployment environment alias.",
            "type": "string",
            "minLength": 1
          },
          "name": {
            "description": "Deployment environment name.",
            "type": "string",
            "minLength": 1
          },
          "host": {
            "description": "Hostname or IP address of the server.",
            "type": "string",
            "minLength": 1
          },
          "port": {
            "description": "Port number of the server.",
            "type": "integer",
            "minimum": 1
          },
          "username": {
            "description": "Username for authentication.",
            "type": "string",
            "minLength": 1
          },
          "password": {
            "description": "Password for password-based user authentication.",
            "type": "string",
            "minLength": 1
          },
          "remotePath": {
            "description": "Deployment path.",
            "type": "string",
            "minLength": 2
          },
          "localPath": {
            "description": "Local upload path.",
            "type": "string",
            "minLength": 1
          },
          "backupPath": {
            "description": "Backup path.",
            "type": "string",
            "minLength": 2
          },
          "privateKey": {
            "$ref": "#/definitions/privateKey"
          },
          "passphrase": {
            "$ref": "#/definitions/passphrase"
          },
          "script": {
            "$ref": "#/definitions/script"
          },
          "backupName": {
            "$ref": "#/definitions/backupName"
          },
          "removeLocalDir": {
            "$ref": "#/definitions/removeLocalDir"
          },
          "clearRemoteDir": {
            "$ref": "#/definitions/clearRemoteDir"
          }
        }
      }
    },
    "plugin": {
      "description": "List of plugins to load and use.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": ["string", "array"],
        "items": [
          {
            "description": "The name of the plugin.",
            "type": "string"
          },
          {
            "description": "The options of the plugin.",
            "type": "object"
          }
        ]
      }
    }
  },
  "required": ["projectName", "modeList"],
  "title": "deployed cli",
  "type": "object"
}
