1- import { commands } from '@circleci/circleci-config-sdk' ;
2- import { Command } from '@circleci/circleci-config-sdk/dist/src/lib/Components/Commands/exports/Command' ;
31import { Field } from 'formik' ;
42import { ReactElement } from 'react' ;
53import InspectorProperty from '../../../atoms/form/InspectorProperty' ;
64
75export interface CommandSubTypes {
86 [ command : string ] : {
9- text : string ;
7+ name : string ;
108 description ?: string ;
119 summary ?: ( command : any ) => ReactElement ;
1210 fields : ReactElement ;
13- generate : ( values : any ) => Command ;
1411 } ;
1512}
1613
1714const commandSubtypes : CommandSubTypes = {
1815 run : {
19- text : 'Run a command' ,
16+ name : 'Run a command' ,
2017 description : 'Used for invoking all command-line programs' ,
2118 summary : ( command ) => (
2219 < p className = "inline" > { command . parameters . command } </ p >
@@ -51,17 +48,15 @@ const commandSubtypes: CommandSubTypes = {
5148 </ InspectorProperty >
5249 </ div >
5350 ) ,
54- generate : ( values ) => new commands . Run ( { ...values . parameters } ) ,
5551 } ,
5652 checkout : {
57- text : 'Checkout' ,
53+ name : 'Checkout' ,
5854 description :
5955 'A special step used to check out source code to the configured path' ,
6056 fields : < InspectorProperty label = "Path" name = "parameters.path" /> ,
61- generate : ( values ) => new commands . Checkout ( { ...values . parameters } ) ,
6257 } ,
6358 persist_to_workspace : {
64- text : 'Persist To Workspace' ,
59+ name : 'Persist To Workspace' ,
6560 description :
6661 'Persist a temporary file to be used by another job in the workflow' ,
6762 fields : (
@@ -70,21 +65,14 @@ const commandSubtypes: CommandSubTypes = {
7065 < InspectorProperty label = "Path" name = "parameters.path" required />
7166 </ div >
7267 ) ,
73- generate : ( values ) =>
74- new commands . workspace . Persist ( {
75- root : values . parameters . root ,
76- paths : [ values . parameters . path ] ,
77- } ) ,
7868 } ,
7969 attach_workspace : {
80- text : 'Attach Workspace' ,
70+ name : 'Attach Workspace' ,
8171 description : 'Attach the workflow’s workspace to the current container' ,
8272 fields : < InspectorProperty label = "At" name = "parameters.at" required /> ,
83- generate : ( values ) =>
84- new commands . workspace . Attach ( { ...values . parameters } ) ,
8573 } ,
8674 store_artifacts : {
87- text : 'Store Artifacts' ,
75+ name : 'Store Artifacts' ,
8876 description : 'Step to store artifacts such as logs and binaries' ,
8977 fields : (
9078 < div >
@@ -102,17 +90,14 @@ const commandSubtypes: CommandSubTypes = {
10290 > </ Field >
10391 </ div >
10492 ) ,
105- generate : ( values ) => new commands . StoreArtifacts ( { ...values . parameters } ) ,
10693 } ,
10794 store_test_results : {
108- text : 'Store Test Results' ,
95+ name : 'Store Test Results' ,
10996 description : 'Upload and store test results for a build' ,
11097 fields : < InspectorProperty label = "Path" name = "parameters.path" required /> ,
111- generate : ( values ) =>
112- new commands . StoreTestResults ( { ...values . parameters } ) ,
11398 } ,
11499 save_cache : {
115- text : 'Save Cache' ,
100+ name : 'Save Cache' ,
116101 description :
117102 'Generates and stores a cache of a file or directory in object storage' ,
118103 fields : (
@@ -127,12 +112,6 @@ const commandSubtypes: CommandSubTypes = {
127112 </ InspectorProperty >
128113 </ div >
129114 ) ,
130- generate : ( values ) =>
131- new commands . cache . Save ( {
132- paths : [ values . parameters . path ] ,
133- key : values . parameters . key ,
134- when : values . parameters . when ,
135- } ) ,
136115 } ,
137116} ;
138117
0 commit comments