diff --git a/CHANGELOG.md b/CHANGELOG.md index 489fe23..63a9609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [v1.4.0](https://github.com/push2cloud/cf-adapter/compare/v1.3.0...v1.4.0) +- added options for dockerImage + ## [v1.3.0](https://github.com/push2cloud/cf-adapter/compare/v1.2.1...v1.3.0) - possibility to create routes with path and port or generatedPort diff --git a/README.md b/README.md index e0aed9e..4a8037a 100644 --- a/README.md +++ b/README.md @@ -427,6 +427,10 @@ __Arguments__ * `disk` - *Optional* The maximum amount of disk available to an instance of an app. i.e. 256MB, 1G, 256, 1024 * `memory` - *Optional* The amount of memory each instance should have. i.e. 256MB, 1G, 256, 1024 * `instances` - *Optional* The number of instances of the app to run. To ensure optimal availability, ensure there are at least 2 instances. + * `dockerImage` - *Optional* Name of the Docker image containing the app. + * `enableSSH` - *Optional* Enable SSHing into the app. Supported for Diego only. false if SSH is disabled globally or on the space, true if enabled for both + * `healthCheckType` - *Optional* Type of health check to perform. 'port' or 'process' + * `healthCheckTimeout` - *Optional* Timeout for health checking of an staged app when starting up * `callback(err, result)` - A callback which is called when function has finished, or an error occurs. __Example__ diff --git a/fns/createApp.js b/fns/createApp.js index 0f5738f..a0b1cd5 100644 --- a/fns/createApp.js +++ b/fns/createApp.js @@ -56,7 +56,12 @@ module.exports = (api) => { environment_json: options.env, disk_quota: convertSize(options.disk) || defaults.disk, memory: convertSize(options.memory) || defaults.memory, - instances: convertSize(options.instances) || defaults.instances + instances: convertSize(options.instances) || defaults.instances, + health_check_type: options.healthCheckType, + health_check_timeout: options.healthCheckTimeout, + diego: options.diego, + enable_ssh: options.enableSSH, + docker_image: options.dockerImage } }, (err, response, result) => { if (result && result.code === 100002) { diff --git a/fns/pushApp.js b/fns/pushApp.js index da9287d..b9b8a09 100644 --- a/fns/pushApp.js +++ b/fns/pushApp.js @@ -1,7 +1,13 @@ +const debug = require('debug')('push2cloud-cf-adapter:pushApp'); + module.exports = (api) => { return (options, callback) => { api.createApp(options, (err, result) => { if (err) return callback(err); + if (!options.path) { + debug('skip to upload app, because no path set for:', options); + return callback(null, result); + } options.appGuid = result.metadata.guid; api.uploadApp(options, (err) => { if (err) return callback(err); diff --git a/fns/updateApp.js b/fns/updateApp.js index d350209..90f90ff 100644 --- a/fns/updateApp.js +++ b/fns/updateApp.js @@ -32,7 +32,12 @@ module.exports = (api) => { disk_quota: convertSize(options.disk) || undefined, memory: convertSize(options.memory) || undefined, instances: convertSize(options.instances) || undefined, - state: options.state + state: options.state, + health_check_type: options.healthCheckType, + health_check_timeout: options.healthCheckTimeout, + diego: options.diego, + enable_ssh: options.enableSSH, + docker_image: options.dockerImage } }, (err, response, result) => { if (err) {