@@ -50,10 +50,16 @@ const run = new Command({
50
50
alias : 'd' ,
51
51
describe : 'Run pipeline and print build ID' ,
52
52
} )
53
+ . option ( 'context' , {
54
+ alias : 'c' ,
55
+ describe : 'Run pipeline with contexts' ,
56
+ default : [ ] ,
57
+ } )
53
58
. example ( 'codefresh run PIPELINE_ID -b=master' , 'Defining the source control context using a branch' )
54
59
. example ( 'codefresh run PIPELINE_ID -s=52b992e783d2f84dd0123c70ac8623b4f0f938d1' , 'Defining the source control context using a commit' )
55
60
. example ( 'codefresh run PIPELINE_ID -b=master -v key1=value1 -v key2=value2' , 'Setting variables through the command' )
56
- . example ( 'codefresh run PIPELINE_ID -b=master --var-file ./var_file.yml' , 'Settings variables through a yml file' ) ;
61
+ . example ( 'codefresh run PIPELINE_ID -b=master --var-file ./var_file.yml' , 'Settings variables through a yml file' )
62
+ . example ( 'codefresh run PIPELINE_ID -b=master --context context' , 'Inject contexts to the pipeline execution' ) ;
57
63
58
64
crudFilenameOption ( yargs , {
59
65
name : 'variable-file' ,
@@ -70,7 +76,7 @@ const run = new Command({
70
76
const noCache = argv [ 'no-cache' ] ;
71
77
const resetVolume = argv [ 'reset-volume' ] ;
72
78
const variablesFromFile = argv [ 'var-file' ] ;
73
-
79
+ const contexts = argv [ 'context' ] ;
74
80
75
81
if ( ! authManager . getCurrentContext ( )
76
82
. isBetaFeatEnabled ( ) ) {
@@ -121,6 +127,7 @@ const run = new Command({
121
127
const variables = prepareKeyValueFromCLIEnvOption ( argv . variable ) ;
122
128
const request = _ . cloneDeep ( executionRequestTemplate ) ;
123
129
request . options . variables = variables ;
130
+ request . options . contexts = contexts ;
124
131
executionRequests . push ( request ) ;
125
132
}
126
133
0 commit comments