diff --git a/web/src/pages/AddUpdatePipeline/AddUpdatePipeline.tsx b/web/src/pages/AddUpdatePipeline/AddUpdatePipeline.tsx index 4a92056e6..0d3df9715 100644 --- a/web/src/pages/AddUpdatePipeline/AddUpdatePipeline.tsx +++ b/web/src/pages/AddUpdatePipeline/AddUpdatePipeline.tsx @@ -18,7 +18,8 @@ import { useAppContext } from 'AppContext' import type { CODEProps } from 'RouteDefinitions' import { getErrorMessage } from 'utils/Utils' import { decodeGitContent } from 'utils/GitUtils' -import pipelineSchema from './schema/pipeline-schema.json' +import pipelineSchemaV1 from './schema/pipeline-schema-v1.json' +import pipelineSchemaV0 from './schema/pipeline-schema-v0.json' import { YamlVersion } from './Constants' import css from './AddUpdatePipeline.module.scss' @@ -205,7 +206,7 @@ const AddUpdatePipeline = (): JSX.Element => { setPipelineAsYaml(value)} /> diff --git a/web/src/pages/AddUpdatePipeline/schema/pipeline-schema-v0.json b/web/src/pages/AddUpdatePipeline/schema/pipeline-schema-v0.json new file mode 100644 index 000000000..d2cf3f667 --- /dev/null +++ b/web/src/pages/AddUpdatePipeline/schema/pipeline-schema-v0.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": ["pipeline"] + }, + "name": { + "type": "string" + }, + "trigger": { + "type": "object", + "properties": { + "event": { + "type": "string" + }, + "branch": { + "type": "array", + "items": { + "type": "string" + } + }, + "path": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["event"] + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "image": { + "type": "string" + }, + "commands": { + "type": "array", + "items": { + "type": "string" + } + }, + "when": { + "type": "string", + "enum": ["on_success", "on_failure", "always"] + }, + "depends_on": { + "type": "array", + "items": { + "type": "string" + } + }, + "environment": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": ["name", "commands"] + } + } + }, + "required": ["kind", "name", "steps"] +} diff --git a/web/src/pages/AddUpdatePipeline/schema/pipeline-schema.json b/web/src/pages/AddUpdatePipeline/schema/pipeline-schema-v1.json similarity index 100% rename from web/src/pages/AddUpdatePipeline/schema/pipeline-schema.json rename to web/src/pages/AddUpdatePipeline/schema/pipeline-schema-v1.json