0

I need to learn how to automatically deploy nodejs applications (MEAN stack). However, with all the stuff out there...

  • Gulp,
  • Mocha,
  • Webpack,
  • Browserify,
  • Require,
  • Flightplan,
  • Jenkins,
  • SemaphoreCI...

I am really confused. What is the standard way to do this?

Toby Allen
  • 10,997
  • 11
  • 73
  • 124
Grateful
  • 9,685
  • 10
  • 45
  • 77
  • 1
    This is an incredibly broad question (there are a zillion possible answers) and I don't know how an answer would be formed that wouldn't be mostly opinion about the best way to go - both of which probably make this question off-topic for stack overflow. – jfriend00 Sep 24 '16 at 06:52
  • That can be said for pretty much any piece of technology, especially given the period that it's going through.... so yes, I agree with you. However, what I am looking for here is something that is currently very popular with developers and possibly something that things are rapidly moving towards... for instance, webpack.... I hope you understand what I mean now. – Grateful Sep 24 '16 at 07:13
  • So... do you have any suggestions? :) – Grateful Sep 24 '16 at 07:13
  • 1
    Please read http://stackoverflow.com/help/on-topic, particular point #4. I don't make the rules here, I just try to help communicate them. There is no standard way to do what you asked. Instead, there are a zillion ways to do it. – jfriend00 Sep 24 '16 at 07:15
  • +1 @jfriend00 also there's a mix of different concepts here, cont deployment is not the same as cont integration, or bundling (and none of these 3 things should be coupled), node.js, angular and mongodb are all deployed differently, deployment depends mostly on the service you're deploying to (AWS, heroku, your server, etc.). You should search for MEAN stack examples or tutorials, this is not a question that would produce useful material for other readers. – Benja Sep 24 '16 at 07:48
  • @Benja - Good point. Yet another explanation of how this question is way too broad and non-specific for stack overflow. – jfriend00 Sep 24 '16 at 07:50
  • @Benja Oh wow... Thank you so much for that. I would have loved to hear more on that from you. For example, what are the recommended tools for continuous deployment vs continuous integration vs bundling. If not, would you kindly point me to a resource? Really appreciated. – Grateful Sep 24 '16 at 08:07
  • @Grateful - You don't seem to understand that this question is off-topic for stack overflow and should be closed. Please revisit the posting rules and form a new question that follows the rules. – jfriend00 Sep 24 '16 at 08:10
  • @jfriend00 Again, thank you. So, let's be "politically correct" and move to another space... where I can ask the same question. Is that okay for you? – Grateful Sep 24 '16 at 08:44

2 Answers2

0

Automate System/Server Setup through Ansible

I think you should have a look at Ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy check out github repo

Ansible is a simple agentless tool which runs purely on ssh.

It consists of a collection of roles which can be included in the definition of a host. A role, in turn, is composed of tasks

A simple task looks like as follows:

//Download  and unpacking node js 
name: Download and unpack nodejs
unarchive: src={{nodejs_tarball_url}} dest={{nodejs_path}} copy=no

//Installing node-gyp on system 
name: Install node-gyp
npm: name=node-gyp global=yes executable={{nodejs_bin_path}}/npm state=present

// More task as per need for e.g setting up mongodb, setting redis etc. 

Checkout some examples to get rid of this.

Pre Deployment Tasks

For pre deployment task like test case running, bundling,minification etc, Integrate some kind of javascript task runners like Grunt

Continuous Integration and Continuous Deployment

  1. Circle Ci
  2. Jenkins
RootHacker
  • 1,109
  • 8
  • 12
  • Apparently, ansible is recommended for simple "deployment"... however, when you need to build, test, etc as well.... other tools may be better. So this brings me back to my original question... – Grateful Sep 24 '16 at 06:01
  • In that case you can integrate grunt or gulp in your app to run task before deployment e.g test case run , minifications etc – RootHacker Sep 24 '16 at 06:05
0

this is JS, mate, there is no standard way :)

To deploy NodeJS app, you don't really need much, for example, if you deploy to Heroku, its just get your commit from the branch you set up and then just run npm install and whatever you wrote in configuration.

With Angular its more complicated, you usually need to bundle it, compile LESS and do other tricks.

As an outcome I would suggest to use some MEAN generator like yeoman https://github.com/angular-fullstack/generator-angular-fullstack to understand how it might work and , probably, you can use something like that in your own project.

Traveler
  • 191
  • 1
  • 10
  • I have heard that yeoman is good for when you want to quickly spin a lot of projects. However, I am looking for something that will allow me to easily go from code to automatically minify, build, test, and deploy. What is the most popular way to do this in javascript? – Grateful Sep 24 '16 at 06:04