File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
lib/interface/cli/commands/hybrid Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,27 @@ const initCmd = new Command({
467
467
condition : ! ! dockerRegistry ,
468
468
} ) ;
469
469
470
+ // update env vars
471
+ installationPlan . addStep ( {
472
+ name : 'update runtime environment with env vars' ,
473
+ func : async ( ) => {
474
+ const reName = installationPlan . getContext ( 'runtimeName' ) ;
475
+ const re = await sdk . runtimeEnvs . get ( { name : reName } ) ;
476
+ let currentEnvVars = _ . get ( re , 'runtimeScheduler.envVars' , { } ) ;
477
+ const envVarsAsObject = envVars . reduce ( ( acc , current ) => {
478
+ const parts = current . split ( '=' ) ;
479
+ // eslint-disable-next-line prefer-destructuring
480
+ acc [ parts [ 0 ] ] = parts [ 1 ] ;
481
+ return acc ;
482
+ } , { } ) ;
483
+ currentEnvVars = _ . merge ( currentEnvVars , envVarsAsObject ) ;
484
+ const body = _ . set ( re , 'runtimeScheduler.envVars' , currentEnvVars ) ;
485
+ await sdk . runtimeEnvs . update ( { name : reName } , _ . merge ( re , body ) ) ;
486
+ console . log ( `Runtime environment "${ colors . cyan ( reName ) } " has been updated with env vars` ) ;
487
+ } ,
488
+ condition : ! ! envVars ,
489
+ } ) ;
490
+
470
491
// set runtime as default
471
492
installationPlan . addStep ( {
472
493
name : 'set new runtime as default' ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.71.6 " ,
3
+ "version" : " 0.71.7 " ,
4
4
"description" : " Codefresh command line utility" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments