Reputation: 447
I am a front-end developer with experience in Ruby on Rails who is currently trying to build an Isomorphic App with React and Node.js. And I have a question about deploying such apps.
While I was developing Ruby applications, there always have been some scripts that would make the deployment process nice and easy — gathering new release from github, uploading it to new release folder, symlinking it to current, precompiling assets. Аnd I can't find something like this for Node.js straight away.
But I am sure that there must be. I am looking for the script that would setup the new virtual machine with all the packages, deploy it, and also would take care of the different environments and their configs (staging, for example). So, what is the idiomatic way to do it with Node.js?
Thanks!
Upvotes: 0
Views: 88
Reputation: 53538
Ruby on Rails has one methodology: rails. On the other hand, Ruby itself has a million methodologies because it's a general purposes programming language. Nodejs is the "Ruby" equivalent of "Ruby on Rails", it is very much not the "Rails" equivalent, and does not come with any one method for doing what you want. It has just as little to do with websites as Ruby, and is just a JavaScript interpreter with a general purpose API.
Only once you pick your "rails" equivalent web framework (like Express
or Hapi
, etc.) can you start asking about deployment scripts, and even then the answer is likely going to be "it's your code, just write your project-specific grunt
or gulp
or npm scripts
tasks to do what you need". There are a ton of packages available for it to automate parts of what you want to do, so it's not as elaborate as "write the code from scratch" but it's also not as simple as "call this one single script". It's going to be the more traditional "chain these several utilities to perform each step, and if the entire chain succeeds, deployment has happened".
E.g.:
None of this needs to be done in individual steps, but maybe you want them to be. Maybe there are steps missing that you'd like there to be, maybe you don't have a staging environment and only a production environment (a little iffy, but possible). Decide on the tasks that need to run, find the utilities that you do them, and then marry them together with your favourite task runner.
Upvotes: 1