277 lines
7.0 KiB
JSON
277 lines
7.0 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://gitlab.com/gitlab-org/step-runner/schema/v1/step",
|
|
"items": {
|
|
"$ref": "#/definitions/step"
|
|
},
|
|
"type": "array",
|
|
"definitions": {
|
|
"step": {
|
|
"description": "Any of these step use cases are valid.",
|
|
"oneOf": [
|
|
{
|
|
"description": "Run a referenced step.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"step"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"$ref": "#/definitions/name"
|
|
},
|
|
"env": {
|
|
"$ref": "#/definitions/namedStrings"
|
|
},
|
|
"inputs": {
|
|
"$ref": "#/definitions/namedValues"
|
|
},
|
|
"step": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/gitReference"
|
|
},
|
|
{
|
|
"$ref": "#/definitions/ociReference"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"description": "Run a sequence of steps.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"run"
|
|
],
|
|
"properties": {
|
|
"env": {
|
|
"$ref": "#/definitions/namedStrings"
|
|
},
|
|
"run": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/step"
|
|
}
|
|
},
|
|
"outputs": {
|
|
"$ref": "#/definitions/namedValues"
|
|
},
|
|
"delegate": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"description": "Run an action.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"action"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"$ref": "#/definitions/name"
|
|
},
|
|
"env": {
|
|
"$ref": "#/definitions/namedStrings"
|
|
},
|
|
"inputs": {
|
|
"$ref": "#/definitions/namedValues"
|
|
},
|
|
"action": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"description": "Run a script.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"script"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"$ref": "#/definitions/name"
|
|
},
|
|
"env": {
|
|
"$ref": "#/definitions/namedStrings"
|
|
},
|
|
"script": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"description": "Exec a binary.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"exec"
|
|
],
|
|
"properties": {
|
|
"env": {
|
|
"$ref": "#/definitions/namedStrings"
|
|
},
|
|
"exec": {
|
|
"description": "Exec is a command to run.",
|
|
"$ref": "#/definitions/exec"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
|
},
|
|
"namedStrings": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"namedValues": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
|
|
"type": [
|
|
"string",
|
|
"number",
|
|
"boolean",
|
|
"null",
|
|
"array",
|
|
"object"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"gitReference": {
|
|
"type": "object",
|
|
"description": "GitReference is a reference to a step in a Git repository.",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"git"
|
|
],
|
|
"properties": {
|
|
"git": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"url",
|
|
"rev"
|
|
],
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"dir": {
|
|
"type": "string"
|
|
},
|
|
"rev": {
|
|
"type": "string"
|
|
},
|
|
"file": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ociReference": {
|
|
"type": "object",
|
|
"description": "OCIReference is a reference to a step hosted in an OCI repository.",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"oci"
|
|
],
|
|
"properties": {
|
|
"oci": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"registry",
|
|
"repository",
|
|
"tag"
|
|
],
|
|
"properties": {
|
|
"registry": {
|
|
"type": "string",
|
|
"description": "The <host>[:<port>] of the container registry server.",
|
|
"examples": [
|
|
"registry.gitlab.com"
|
|
]
|
|
},
|
|
"repository": {
|
|
"type": "string",
|
|
"description": "A path within the registry containing related OCI images. Typically the namespace, project, and image name.",
|
|
"examples": [
|
|
"my_group/my_project/image"
|
|
]
|
|
},
|
|
"tag": {
|
|
"type": "string",
|
|
"description": "A pointer to the image manifest hosted in the OCI repository.",
|
|
"examples": [
|
|
"latest",
|
|
"1",
|
|
"1.5",
|
|
"1.5.0"
|
|
]
|
|
},
|
|
"dir": {
|
|
"type": "string",
|
|
"description": "A directory inside the OCI image where the step can be found.",
|
|
"examples": [
|
|
"/my_steps/hello_world"
|
|
]
|
|
},
|
|
"file": {
|
|
"type": "string",
|
|
"description": "The name of the file that defines the step, defaults to step.yml.",
|
|
"examples": [
|
|
"step.yml"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"exec": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"command"
|
|
],
|
|
"properties": {
|
|
"command": {
|
|
"type": "array",
|
|
"description": "Command are the parameters to the system exec API. It does not invoke a shell.",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"minItems": 1
|
|
},
|
|
"work_dir": {
|
|
"type": "string",
|
|
"description": "WorkDir is the working directly in which `command` will be exec'ed."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|