Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

nodejs cartridge: use npm install --production #5215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

nodejs cartridge: use npm install --production #5215

wants to merge 1 commit into from

Conversation

Filirom1
Copy link
Contributor

In the npm config doc it's explained that -d means --loglevel info.

Moreover,

By default, npm install will install all modules listed as dependencies. With the --production flag, npm will not install modules listed in devDependencies.

https://www.npmjs.org/doc/cli/npm-install.html

devDependencies are used for tests. We don't want to download tests dependencies when we deploy to openshift. It will make build faster for nodejs projects.

@danmcp
Copy link
Contributor

danmcp commented Apr 10, 2014

[test]

@openshift-bot
Copy link

@mfojtik
Copy link
Contributor

mfojtik commented Apr 10, 2014

@danmcp @Filirom1 how about Jenkins, in case when users do want to run tests and for that they would need to install dev dependencies.... Can we make it configurable? Like --production as default but also ENV var, where you can set 'development' in case you want to run tests?

@Filirom1
Copy link
Contributor Author

The JbossEWS cartridge skip test too.
https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-jbossews/bin/build#L53

Is there some convention for executing tests on jenkins?

@Filirom1
Copy link
Contributor Author

Or I could use a NPM_ARGS environement variable, and if not defined I set it to --production --loglevel info

@danmcp
Copy link
Contributor

danmcp commented Aug 27, 2014

@Filirom1 It would make sense to me to do similar to other carts and have a development and production type modes triggered by environment vars. Typically production is the default.

@openshift-bot
Copy link

Evaluated for online test up to 73484c6

@marvinroger
Copy link

Is there anything new? Applications these days have so much devDeps, with gulp, mocha, browserify, stylus, all this kind of stuff. Deploying litterally takes tens of minutes!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants