mirror of
https://github.com/harness/drone.git
synced 2025-05-13 23:50:47 +08:00
adding V0 schema for demo
This commit is contained in:
parent
7fb900c42e
commit
376d7ed5f3
@ -18,7 +18,8 @@ import { useAppContext } from 'AppContext'
|
|||||||
import type { CODEProps } from 'RouteDefinitions'
|
import type { CODEProps } from 'RouteDefinitions'
|
||||||
import { getErrorMessage } from 'utils/Utils'
|
import { getErrorMessage } from 'utils/Utils'
|
||||||
import { decodeGitContent } from 'utils/GitUtils'
|
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 { YamlVersion } from './Constants'
|
||||||
|
|
||||||
import css from './AddUpdatePipeline.module.scss'
|
import css from './AddUpdatePipeline.module.scss'
|
||||||
@ -205,7 +206,7 @@ const AddUpdatePipeline = (): JSX.Element => {
|
|||||||
<Container className={css.editorContainer}>
|
<Container className={css.editorContainer}>
|
||||||
<MonacoSourceCodeEditor
|
<MonacoSourceCodeEditor
|
||||||
language={'yaml'}
|
language={'yaml'}
|
||||||
schema={version === YamlVersion.V0 ? {} : pipelineSchema}
|
schema={version === YamlVersion.V0 ? pipelineSchemaV0 : pipelineSchemaV1}
|
||||||
source={pipelineAsYAML}
|
source={pipelineAsYAML}
|
||||||
onChange={(value: string) => setPipelineAsYaml(value)}
|
onChange={(value: string) => setPipelineAsYaml(value)}
|
||||||
/>
|
/>
|
||||||
|
@ -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"]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user