Skip to content

Commit

Permalink
Update megalinter-descriptor.jsonschema for supported platforms at th…
Browse files Browse the repository at this point in the history
…e descriptor level.
  • Loading branch information
echoix authored and bdovaz committed Mar 26, 2023
1 parent d6c9895 commit b48a259
Showing 1 changed file with 113 additions and 0 deletions.
113 changes: 113 additions & 0 deletions megalinter/descriptors/schemas/megalinter-descriptor.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,119 @@
"title": "Installation requirements",
"type": "object"
},
"supported_platforms": {
"$id": "#/properties/supported_platforms",
"description": "Specifies the supported target platforms (OS, CPU architecture, CPU variant) for the install of this descriptor, and optionally overrides install instructions for a specific platform. Uses the same [architecture naming conventions as Docker](https://docs.docker.com/desktop/multi-arch/).",
"properties": {
"platform": {
"$id": "#/properties/supported_platforms/properties/platform",
"description": "The list of target platforms (OS/CPU architecture/CPU Variant) that this descriptor supports.",
"default": [
"linux/amd64"
],
"uniqueItems": true,
"items": {
"type": "string",
"description": "Target platforms [available to use on Docker](https://github.com/docker-library/bashbrew/blob/v0.1.2/architecture/oci-platform.go#L14-L27).\n***Please note that Megalinter does not support all Docker's platforms.***",
"enum": [
"linux/amd64",
"linux/arm64",
"linux/arm/v7",
"linux/arm/v5",
"linux/386",
"linux/mips64le",
"linux/ppc64le",
"linux/riscv64",
"linux/s390x",
"windows/amd64"
],
"title": "Target platform",
"default": "linux/amd64"
},
"examples": [
{
"platform": [
"linux/amd64",
"linux/arm64"
]
},
{
"platform": [
"linux/amd64"
]
}
],
"type": "array",
"title": "List of target platforms"
},
"install_override": {
"$id": "#/properties/supported_platforms/properties/install_override",
"description": "Defines special installation steps for a specific platform (OS/CPU architecture/CPU variant), replacing the descriptor's install instructions given in the `install` node for this target platform only.",
"items": {
"properties": {
"platform": {
"$id": "#/properties/supported_platforms/properties/install_override/items/properties/platform",
"description": "Target platform (OS/CPU architecture/CPU variant) to define special installation steps for.",
"$ref": "#/properties/supported_platforms/properties/platform/items",
"default": "linux/arm64",
"type": "string",
"examples": []
},
"install": {
"$id": "#/properties/supported_platforms/properties/install_override/items/properties/install",
"description": "List of apk, dockerfile instructions, npm/pip/gem packages required to use the descriptor's linters.\nThese special installation steps replace the instructions in the descriptor's [`install`](#install) node when using this target platform pair only.",
"$ref": "#/properties/install"
}
},
"type": "object",
"required": [
"platform",
"install"
]
},
"title": "Installation requirements override",
"type": "array"
}
},
"default": {
"platform": [
"linux/amd64"
]
},
"examples": [
{
"platform": [
"linux/amd64",
"linux/arm64"
]
},
{
"platform": [
"linux/amd64"
]
},
{
"platform": [
"linux/amd64",
"linux/arm64"
],
"install_override": [
{
"platform": "linux/arm64",
"install": {
"dockerfile": [
"ARG PWSH_VERSION='latest'",
"ARG PWSH_DIRECTORY='/opt/microsoft/powershell'",
"RUN mkdir -p ${PWSH_DIRECTORY} \\\n && curl --retry 5 --retry-delay 5 -s https://api.github.com/repos/powershell/powershell/releases/${PWSH_VERSION} \\\n | grep browser_download_url \\\n | grep linux-arm64 \\\n | cut -d '\"' -f 4 \\\n | xargs -n 1 wget -O - \\\n | tar -xzC ${PWSH_DIRECTORY} \\\n && ln -sf ${PWSH_DIRECTORY}/pwsh /usr/bin/pwsh\n"
]
}
}
]
}
],
"title": "Supported platforms",
"type": "object"
},
"lint_all_files": {
"$id": "#/properties/lint_all_files",
"default": false,
Expand Down

0 comments on commit b48a259

Please sign in to comment.