Skip to content

Commit

Permalink
add install-dev flag to deploynodeapp
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Oct 11, 2017
1 parent b56cb38 commit 23b78be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ for organization name, all of which are required.
`--resolve-modules -R`
(optional) If the API proxy includes Node.js modules (e.g., in a `node_modules` directory), this option updates them on Apigee Edge without uploading them from your system. Basically, it's like running "npm install" on Apigee Edge in the root directory of the API proxy bundle.

`--install-dev -I`
(optional) If the Node.js application contains `devDependencies` that you would like to be installed when resolving modules in Apigee, use this flag. Otherwise the `npm install` will be run with `--production`.

`--upload-modules -U`
(optional) If specified, uploads Node.js modules from your system to Apigee Edge rather than resolving the modules directly on Apigee Edge (the default behavior).

Expand Down
10 changes: 10 additions & 0 deletions lib/commands/deploynodeapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ var descriptor = defaults.defaultDescriptor({
name: 'Wait N seconds after importing proxy before deploying',
shortOption: 'W',
required: false
},
'install-dev': {
name: 'Include devDependencies when resolving modules in Apigee',
shortOption:'I',
required: false,
toggle: true
}
});
module.exports.descriptor = descriptor;
Expand Down Expand Up @@ -601,6 +607,10 @@ function runNpm(opts, request, done) {
body.verbose = true;
}

if (opts['install-dev']) {
body.production = false;
}

request({
uri: util.format('%s/v1/o/%s/apis/%s/revisions/%d/npm',
opts.baseuri, opts.organization, opts.api, opts.deploymentVersion),
Expand Down

0 comments on commit 23b78be

Please sign in to comment.