Peter Throwson Peter Throwson - 23 days ago 13
Node.js Question

Is there a deployment tool similar to Fabric written in JavaScript?

I put together a mobile development stack that is almost entirely using Javascript on node.js. With the only exception of SASS (prefer it to LESS) and Fabric. I prefer not to pollute my development directory and as I have to combine and minify JS and CSS anyway, I thought I could also use node.js to serve my code.

I would like to reduce my dependence on Ruby and/or Python. I don't really use all features of Fabric so I have the hope of replacing it. But I couldn't find any similar tool written in Javascript.

All I need is to:


  • Pull from git repository.

  • Install depencies locally.

  • Minify and combine JS/CSS invoking require.js/SASS.

  • Run testsuite.

  • Serve the code via node.js for hands-on or testing with Ripple.



Fabric might already be overkill, I only use it for my Python web projects because the necessary servers don't run on my machine, but that wouldn't be the case here. What would be the best way to handle this without Fabric?

Answer

I've been pondering the same question myself.

The most promising direct candidate I've found so far is launch (https://github.com/bengourley/launch). However, it hasn't been updated in like a year, which makes me a little suspicious about its future status.

In the absense of obviously good solutions, I ended up solving the whole build/deployment problem, piece by piece in the following fashion:

  • After some trial and error, I removed node_modules from .gitignore. One of the implications is that you don't have to install dependencies locally, removing the second step (try if reading this convinces you as well).
  • I ended up automating JS/CSS processing, linting and test suite running with grunt. Highly recommended.
  • I'm lazy and just now I'm adding the minified stuff into git (hopefully I will change this at some point).
    • Edit: I no longer add minified stuff into git, but instead run grunt when deploying to do the minification

By doing so, I effectively eliminated some of the need for Fabric altogether, leaving only the actual deployment to be solved:

  1. The best solution (deployment-wise) is to avoid running your own servers and use ready, cloud-solutions such as Heroku or Nodejitsu
  2. Alternatively, you could host your own node.js deployment tools. For instance you can install Nodester on your own servers and use the provided APIs and tools.
  3. On a Linux box, it is very easy to write one-liners that re-deploy a node.js app, so I don't feel like I need to use any extra tools (besides bash) for that.

That being said, I too would be glad to hear about better solutions.

Edit: just found out about deploy (https://github.com/visionmedia/deploy). Seems very promising. You could try that as well!

Comments