Skip to content

Commit 50125b8

Browse files
committed
refact
1 parent 2bfb2b7 commit 50125b8

File tree

2 files changed

+385
-183
lines changed

2 files changed

+385
-183
lines changed

specs/pipeline/ci-pipeline-build-spec.yaml

Lines changed: 382 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,56 @@ servers:
1616
description: Devtron Orchestrator API Server
1717

1818
paths:
19+
/orchestrator/app/ci-pipeline/{appId}/{ciPipelineId}:
20+
get:
21+
description: get CI pipeline details
22+
operationId: GetCiPipeline
23+
parameters:
24+
- name: appId
25+
in: path
26+
required: true
27+
schema:
28+
type: integer
29+
- name: ciPipelineId
30+
in: path
31+
required: true
32+
schema:
33+
type: integer
34+
responses:
35+
'200':
36+
description: Successfully get the pipeline config
37+
content:
38+
application/json:
39+
schema:
40+
properties:
41+
code:
42+
type: integer
43+
description: status code
44+
status:
45+
type: string
46+
description: status
47+
result:
48+
type: array
49+
items:
50+
$ref: '#/components/schemas/CiPipelineDto'
51+
'400':
52+
description: Bad Request. Input Validation error/wrong request body.
53+
content:
54+
application/json:
55+
schema:
56+
$ref: '#/components/schemas/Error'
57+
'500':
58+
description: Internal Server Error
59+
content:
60+
application/json:
61+
schema:
62+
$ref: '#/components/schemas/Error'
63+
'403':
64+
description: Unauthorized User
65+
content:
66+
application/json:
67+
schema:
68+
$ref: '#/components/schemas/Error'
1969
/orchestrator/app/commit-info/{ciPipelineMaterialId}/{gitHash}:
2070
get:
2171
tags:
@@ -184,6 +234,338 @@ paths:
184234

185235
components:
186236
schemas:
237+
CiPipelineDto:
238+
type: object
239+
properties:
240+
appId:
241+
type: integer
242+
action:
243+
type: integer
244+
appWorkflowId:
245+
type: integer
246+
ciPipeline:
247+
$ref: '#/components/schemas/CiPipelineDetails'
248+
CiPipelineDetails:
249+
type: object
250+
properties:
251+
id:
252+
type: integer
253+
active:
254+
type: boolean
255+
isExternal:
256+
type: boolean
257+
isManual:
258+
type: boolean
259+
linkedCount:
260+
type: integer
261+
name:
262+
type: string
263+
scanEnabled:
264+
type: boolean
265+
dockerArgs:
266+
type: array
267+
items:
268+
$ref: '#/components/schemas/DockerArg'
269+
externalCiConfig:
270+
$ref: '#/components/schemas/ExternalCiConfig'
271+
ciMaterial:
272+
$ref: '#/components/schemas/CiMaterial'
273+
beforeDockerBuildScripts:
274+
type: array
275+
items:
276+
$ref: '#/components/schemas/DockerBuildScript'
277+
afterDockerBuildScripts:
278+
type: array
279+
items:
280+
$ref: '#/components/schemas/DockerBuildScript'
281+
preBuildStage:
282+
$ref: '#/components/schemas/BuildStageDto'
283+
postBuildStage:
284+
$ref: '#/components/schemas/BuildStageDto'
285+
DockerBuildScript:
286+
type: object
287+
properties:
288+
id:
289+
type: integer
290+
index:
291+
type: integer
292+
name:
293+
type: string
294+
outputLocation:
295+
type: string
296+
script:
297+
type: string
298+
BuildStageDto:
299+
type: object
300+
properties:
301+
id:
302+
type: integer
303+
description: pipelineStageId(every stage is given a Id)
304+
steps:
305+
type: array
306+
items:
307+
$ref: '#/components/schemas/stageStepDetails'
308+
stageStepDetails:
309+
type: object
310+
properties:
311+
id:
312+
type: integer
313+
index:
314+
type: integer
315+
description: sequence of step in all steps
316+
name:
317+
type: string
318+
description:
319+
type: string
320+
stepType:
321+
type: string
322+
example:
323+
- "INLINE"
324+
- "REF_PLUGIN"
325+
outputDirectoryPath:
326+
type: array
327+
items:
328+
type: string
329+
inlineStepDetail:
330+
$ref: '#/components/schemas/InlineStepDetail'
331+
pluginRefStepDetail:
332+
$ref: '#/components/schemas/PluginRefStepDetail'
333+
InlineStepDetail:
334+
type: object
335+
properties:
336+
scriptType:
337+
type: string
338+
example:
339+
- "SHELL"
340+
- "DOCKERFILE"
341+
- "CONTAINER_IMAGE"
342+
script:
343+
type: string
344+
storeScriptAt:
345+
type: string
346+
dockerFileExists:
347+
type: boolean
348+
mountPath:
349+
type: string
350+
mountCodeToContainer:
351+
type: boolean
352+
mountCodeToContainerPath:
353+
type: string
354+
mountDirectoryFromHost:
355+
type: boolean
356+
containerImagePath:
357+
type: string
358+
imagePullSecretType:
359+
type: string
360+
example:
361+
- "CONTAINER_REGISTRY"
362+
- "SECRET_PATH"
363+
imagePullSecret:
364+
type: string
365+
mountPathMap:
366+
type: array
367+
items:
368+
$ref: '#/components/schemas/MountPathMap'
369+
commandArgsMap:
370+
type: array
371+
items:
372+
$ref: '#/components/schemas/CommandArgMap'
373+
portMap:
374+
type: array
375+
items:
376+
$ref: '#/components/schemas/PortMap'
377+
inputVariables:
378+
type: array
379+
items:
380+
$ref: '#/components/schemas/PipelineStepsVariableDto'
381+
outputVariables:
382+
type: array
383+
items:
384+
$ref: '#/components/schemas/PipelineStepsVariableDto'
385+
conditionDetails:
386+
type: array
387+
items:
388+
$ref: '#/components/schemas/ConditionDetail'
389+
PluginRefStepDetail:
390+
type: object
391+
properties:
392+
pluginId:
393+
type: integer
394+
description: id of the plugin used in the step
395+
inputVariables:
396+
type: array
397+
items:
398+
$ref: '#/components/schemas/PluginVariableDto'
399+
outputVariables:
400+
type: array
401+
items:
402+
$ref: '#/components/schemas/PluginVariableDto'
403+
conditionDetails:
404+
type: array
405+
items:
406+
$ref: '#/components/schemas/ConditionDetail'
407+
PluginVariableDto:
408+
type: object
409+
properties:
410+
name:
411+
type: string
412+
description: Variable name
413+
description:
414+
type: string
415+
description: Variable description
416+
type:
417+
type: string
418+
description: Variable type
419+
format:
420+
type: string
421+
description: Variable format
422+
required:
423+
type: boolean
424+
description: Whether the variable is required
425+
defaultValue:
426+
type: string
427+
description: Default value for the variable
428+
PipelineStepsVariableDto:
429+
type: object
430+
properties:
431+
id:
432+
type: integer
433+
name:
434+
type: string
435+
value:
436+
type: integer
437+
format:
438+
type: string
439+
example:
440+
- "STRING"
441+
- "NUMBER"
442+
- "BOOL"
443+
- "DATE"
444+
description:
445+
type: string
446+
defaultValue:
447+
type: string
448+
refVariableUsed:
449+
type: boolean
450+
refVariableType:
451+
type: string
452+
example:
453+
- "GLOBAL"
454+
- "FROM_PREVIOUS_STEP"
455+
- "NEW"
456+
refVariableStepIndex:
457+
type: integer
458+
refVariableName:
459+
type: string
460+
refVariableStage:
461+
type: string
462+
example:
463+
- "PRE_CI"
464+
- "POST_CI"
465+
ConditionDetail:
466+
type: object
467+
properties:
468+
id:
469+
type: integer
470+
conditionOnVariable:
471+
type: string
472+
description: name of the variable on which condition is applied
473+
conditionOperator:
474+
type: string
475+
conditionType:
476+
type: string
477+
example:
478+
- "SKIP"
479+
- "TRIGGER"
480+
- "SUCCESS"
481+
- "FAIL"
482+
conditionalValue:
483+
type: string
484+
MountPathMap:
485+
type: object
486+
properties:
487+
filePathOnDisk:
488+
type: string
489+
filePathOnContainer:
490+
type: string
491+
CommandArgMap:
492+
type: object
493+
properties:
494+
command:
495+
type: string
496+
args:
497+
type: array
498+
items:
499+
type: string
500+
PortMap:
501+
type: object
502+
properties:
503+
portOnLocal:
504+
type: integer
505+
portOnContainer:
506+
type: integer
507+
Error:
508+
type: object
509+
properties:
510+
code:
511+
type: integer
512+
description: Error code
513+
status:
514+
type: string
515+
description: Error status
516+
errors:
517+
type: array
518+
items:
519+
type: object
520+
properties:
521+
code:
522+
type: integer
523+
description: Error code
524+
internalMessage:
525+
type: string
526+
description: Internal error message
527+
userMessage:
528+
type: string
529+
description: User friendly error message
530+
DockerArg:
531+
type: object
532+
description: map of key value pairs
533+
properties:
534+
key:
535+
type: string
536+
value:
537+
type: string
538+
ExternalCiConfig:
539+
type: object
540+
properties:
541+
id:
542+
type: integer
543+
accessKey:
544+
type: string
545+
webhookUrl:
546+
type: string
547+
payload:
548+
type: string
549+
CiMaterial:
550+
type: array
551+
items:
552+
$ref: '#/components/schemas/CiMaterialDetail'
553+
CiMaterialDetail:
554+
type: object
555+
properties:
556+
id:
557+
type: integer
558+
gitMaterialId:
559+
type: integer
560+
source:
561+
type: object
562+
properties:
563+
type:
564+
type: string
565+
example: "SOURCE_TYPE_BRANCH_FIXED"
566+
value:
567+
type: string
568+
example: "master"
187569
CommitInfo:
188570
type: object
189571
required:

0 commit comments

Comments
 (0)