Skip to content

Commit

Permalink
added options for dockerImage
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Aug 25, 2016
1 parent 0af1b6f commit 7bded93
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
7 changes: 6 additions & 1 deletion fns/createApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions fns/pushApp.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
7 changes: 6 additions & 1 deletion fns/updateApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7bded93

Please sign in to comment.