File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
interface/cli/commands/pipeline/dynamic Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ const install = new Command({
5757 description : 'Contexts (yaml || secret-yaml) to be passed to the install' ,
5858 array : true ,
5959 } )
60+ . option ( 'set' , {
61+ description : 'set of KEY=VALUE to be passed to the install' ,
62+ array : true ,
63+ } )
6064 . option ( 'detach' , {
6165 alias : 'd' ,
6266 describe : 'Run pipeline and print build ID' ,
@@ -76,6 +80,7 @@ const install = new Command({
7680 version : argv . version ,
7781 values : argv . context ,
7882 tillerNamespace : argv . tillerNamespace ,
83+ setValues : argv . set ,
7984 } ) ;
8085 if ( argv . detach ) {
8186 console . log ( workflowId ) ;
Original file line number Diff line number Diff line change @@ -37,6 +37,23 @@ const _normalizeValues = async (values = []) => {
3737 return normalizedValues ;
3838} ;
3939
40+ const _normalizeSetValues = async ( values = [ ] ) => {
41+ const normalizedValues = await Promise . reduce ( values , async ( normalized , givenValue ) => {
42+ const [ key , value ] = givenValue . split ( '=' ) ;
43+ if ( ! key || ! value ) {
44+ throw new Error ( 'Passed set value must be in format KEY=VALUE' ) ;
45+ }
46+ const setObject = {
47+ key,
48+ value,
49+ } ;
50+ normalized . push ( setObject ) ;
51+ return normalized ;
52+ } , [ ] ) ;
53+
54+ return normalizedValues ;
55+ } ;
56+
4057const installChart = async ( {
4158 cluster,
4259 namespace,
@@ -46,8 +63,10 @@ const installChart = async ({
4663 values,
4764 releaseName,
4865 tillerNamespace,
66+ setValues,
4967} ) => {
5068 const normalizedValues = await _normalizeValues ( values ) ;
69+ const normalizedSetValues = await _normalizeSetValues ( setValues ) ;
5170 const options = {
5271 url : '/api/kubernetes/chart/install' ,
5372 method : 'POST' ,
@@ -62,6 +81,7 @@ const installChart = async ({
6281 values : normalizedValues ,
6382 version,
6483 releaseName,
84+ set : normalizedSetValues ,
6585 } ,
6686 } ;
6787
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.8.2 " ,
3+ "version" : " 0.8.3 " ,
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