Why do PaaS provider suggest Dependency installation during deployment? (for PHP or NodeJS and probably others)

StackOverflow https://stackoverflow.com//questions/24013078

Question

PaaS providers like Heroku, CloudControl or Exoscale offer deployment using git.

They automatically download dependencies for nodeJS or PHP/Composer applications after pushing the source code. Why?

Why would i not fetch my dependencies locally and upload them to the PaaS provider, e.g. including them in the git repository?

What is the benefit of downloading dependencies/executing "node install" oder "composer install" after executing a git push ?

Was it helpful?

Solution

Dependency files should generally not be commited into version control because it usually does not make sense to keep version history about them; because they are potentially OS- or hardware specific and they increase the repository size significantly, making many operations slower. Downloading and building the dependencies in the build process ensures they are compatible with the production runtime, but this is less important for some programming languages than others ofcourse. Notwithstanding this, there can be cases were it does make sense to include dependencies in git. For example when the app is tightly coupled to them (or even modifying them).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top