From e910df110cf29c493e0179c7fe9fe370f8567344 Mon Sep 17 00:00:00 2001 From: olegs-codefresh Date: Mon, 8 Jan 2018 11:57:08 +0200 Subject: [PATCH] support passing secret-yaml as context to install-chart cmd --- examples/secret-yaml.yaml | 15 +++++++++++++++ lib/interface/cli/commands/context/create.cmd.js | 2 +- lib/interface/cli/commands/context/get.cmd.js | 2 +- .../pipeline/dynamic/install-chart.cmd.js | 2 +- lib/logic/api/helm.js | 1 + package.json | 4 ++-- 6 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 examples/secret-yaml.yaml diff --git a/examples/secret-yaml.yaml b/examples/secret-yaml.yaml new file mode 100644 index 000000000..6678616c1 --- /dev/null +++ b/examples/secret-yaml.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +# Using this example you can install helm mongodb chart and set the service type as LoadBalancer instaed default ClusterIp +# https://github.com/kubernetes/charts/blob/master/stable/mongodb/values.yaml +kind: context +owner: account +metadata: + name: helm-mongo-secret-values +spec: + type: secret-yaml + data: + # All the values will be encrypted + serviceType: LoadBalancer + image: mongo + type: + - "encrypted" \ No newline at end of file diff --git a/lib/interface/cli/commands/context/create.cmd.js b/lib/interface/cli/commands/context/create.cmd.js index dce4e641a..c51198acb 100644 --- a/lib/interface/cli/commands/context/create.cmd.js +++ b/lib/interface/cli/commands/context/create.cmd.js @@ -17,7 +17,7 @@ const command = new Command({ }) .positional('type', { describe: 'Type of the context', - choices: ['config', 'secret', 'helm-repository', 'plain-yaml'], + choices: ['config', 'secret', 'helm-repository', 'plain-yaml', 'secret-yaml'], }) .option('owner', { describe: 'Owner of the context', diff --git a/lib/interface/cli/commands/context/get.cmd.js b/lib/interface/cli/commands/context/get.cmd.js index bc728cfe7..aaa8a293e 100644 --- a/lib/interface/cli/commands/context/get.cmd.js +++ b/lib/interface/cli/commands/context/get.cmd.js @@ -19,7 +19,7 @@ const command = new Command({ }) .option('type', { describe: 'Specific type of context', - choices: ['config', 'secret', 'helm-repository'], + choices: ['config', 'secret', 'helm-repository', 'plain-yaml', 'secret-yaml'], }) .option('owner', { describe: 'Owner of the context', diff --git a/lib/interface/cli/commands/pipeline/dynamic/install-chart.cmd.js b/lib/interface/cli/commands/pipeline/dynamic/install-chart.cmd.js index b76353532..e111815fb 100644 --- a/lib/interface/cli/commands/pipeline/dynamic/install-chart.cmd.js +++ b/lib/interface/cli/commands/pipeline/dynamic/install-chart.cmd.js @@ -58,7 +58,7 @@ const install = new Command({ name: argv.name, repository: argv.repository, version: argv.version, - values: argv.values, + values: argv.context, tillerNamespace: argv.tillerNamespace, }); console.log(`Started with id: ${workflowId}`); diff --git a/lib/logic/api/helm.js b/lib/logic/api/helm.js index 02df1cb28..5f797cb91 100644 --- a/lib/logic/api/helm.js +++ b/lib/logic/api/helm.js @@ -6,6 +6,7 @@ const { getContextByName } = require('./context'); const SUPPORTED_TYPES = [ 'plain-yaml', + 'secret-yaml', ]; diff --git a/package.json b/package.json index 34650e665..8a13ea7b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codefresh", - "version": "0.5.8", + "version": "0.5.9", "description": "Codefresh command line utility", "main": "index.js", "preferGlobal": true, @@ -21,7 +21,6 @@ "scripts": "lib/**/*.js" }, "dependencies": { - "firebase": "git+https://github.com/codefresh-io/firebase.git#80b2ed883ff281cd67b53bd0f6a0bbd6f330fed5", "@codefresh-io/docker-reference": "^0.0.5", "bluebird": "^3.5.1", "cf-errors": "^0.1.11", @@ -30,6 +29,7 @@ "columnify": "^1.5.4", "debug": "^3.1.0", "filesize": "^3.5.11", + "firebase": "git+https://github.com/codefresh-io/firebase.git#80b2ed883ff281cd67b53bd0f6a0bbd6f330fed5", "js-yaml": "^3.10.0", "jsonwebtoken": "^8.1.0", "kefir": "^3.8.0",