From 692ed5f8b94d52aa04a78bf536b7dc8001e64558 Mon Sep 17 00:00:00 2001 From: Christian Compton Date: Sun, 20 Aug 2017 19:25:08 -0500 Subject: [PATCH] feat: kubernetes helm support --- package.json | 2 +- refresh/index.js | 2 +- test/integration/app/prompted_nobuild.js | 18 ++++++++++++++++++ test/unit/refresh.js | 3 +-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7805bcb5..250b14ab 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "generator" ], "dependencies": { - "@arf/generator-cloud-enablement": "0.0.25", + "@arf/generator-cloud-enablement": "0.0.32", "bluebird": "^3.5.0", "chalk": "^1.1.0", "debug": "^2.2.0", diff --git a/refresh/index.js b/refresh/index.js index bf13deaa..9a147aa5 100644 --- a/refresh/index.js +++ b/refresh/index.js @@ -1293,7 +1293,7 @@ module.exports = Generator.extend({ writeKubernetesFiles: function () { if (!this.docker) return - var server = (this.bluemix.domain && this.bluemix.namespace) ? {domain: this.bluemix.domain, namespace: this.bluemix.namespace } : undefined; + var server = (this.bluemix && this.bluemix.domain && this.bluemix.namespace) ? {domain: this.bluemix.domain, namespace: this.bluemix.namespace } : undefined; this.composeWith(require.resolve('@arf/generator-cloud-enablement/generators/kubernetes'), {force: this.force, bluemix: { backendPlatform: "SWIFT", name: this.cleanAppName, server: server }} ) }, diff --git a/test/integration/app/prompted_nobuild.js b/test/integration/app/prompted_nobuild.js index eb35243c..79fc0234 100644 --- a/test/integration/app/prompted_nobuild.js +++ b/test/integration/app/prompted_nobuild.js @@ -292,6 +292,24 @@ describe('Prompt and no build integration tests for app generator', function () }) }) + describe('Kubernetes files', function () { + it('created helm chart file', function () { + assert.file('chart/notes/Chart.yaml') + }) + + it('created helm deployment file', function () { + assert.file('chart/notes/templates/deployment.yaml') + }) + + it('created helm service file', function () { + assert.file('chart/notes/templates/service.yaml') + }) + + it('created helm values file', function () { + assert.file('chart/notes/values.yaml') + }) + }) + describe('Bluemix cloud deployment', function () { it('created CloudFoundry manifest file', function () { assert.file('manifest.yml') diff --git a/test/unit/refresh.js b/test/unit/refresh.js index c331062e..b37b40ee 100644 --- a/test/unit/refresh.js +++ b/test/unit/refresh.js @@ -1552,8 +1552,7 @@ describe('swiftserver:refresh', function () { }) it('populates the correct values in values.yaml', function () { - assert.fileContent('chart/test/values.yaml', 'name: test') - assert.fileContent('chart/test/values.yaml', 'repository: registry.mydomain.net/mynamespace/') + assert.fileContent('chart/test/values.yaml', 'repository: registry.mydomain.net/mynamespace/test') }) })