strongloop / strong-pm

deployer for node applications
http://strong-pm.io
Other
1k stars 71 forks source link

npm tarballs - Offline Deployments from .cache #395

Closed sray closed 4 years ago

sray commented 7 years ago

I have been following the recommendations in https://github.com/npm/npm/issues/4210 and https://github.com/npm/npm/issues/3429 for bundling a nodejs application and deploying it using a packaged node_modules and .cache directory within the tarball (described in https://github.com/npm/npm/issues/3429#issuecomment-17718608). Until npm integrates the discussed workflow into an npm core command, this seemed the easiest and most straight forward way to realize an offline deployment solution. I use a separate release branch, in which I maintain an npm-shrinkwrap.json to lock dependency versions for tagged release commits. I generate the tarballs from those tagged commits, so it is theoretically possible to reproduce an identical older release tarball if necessary for debugging later.

I would love to also utilize the excellent monitoring strongloop provides. To be able to do that, strongloop needs to provide a tarball deployment step, that a) does not trigger a git commit (both local-deploy.js and pack-receiver.js trigger one) b) that runs npm install with custom arguments, for performing an offline deployment using the "cache-min" workaround (described here: https://github.com/npm/npm/issues/5509#issuecomment-53724715).

I would be happy to submit a PR, but wanted to discuss the best way to implement these two things first. For a) I would add an argument to slc deploy like --without-vcs, --no-vcs-update or --dont-commit or anything else, you think is a good name. If you would prefer to handle this differently, let me know your thoughts. For b) I would add an argument to slc deploy like --npm-args which is passed on to the npm install command, for offline deployments it's usage would look like: --npm-args="--cache=.cache --cache-min 99999. Or do you have a more suitable idea in mind?

If you prefer single characters as command line arguments (or would like to provide both short and long commands), let me know which characters I should use.

Any feedback would be much appreciated!

Are there any automated tests or js linting that I can run to ensure I do not break anything or divert from strongloop coding styles?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding.