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({
467467 condition : ! ! dockerRegistry ,
468468 } ) ;
469469
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+
470491 // set runtime as default
471492 installationPlan . addStep ( {
472493 name : 'set new runtime as default' ,
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.71.6 " ,
3+ "version" : " 0.71.7 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments