xnnngw
Last Updated: February 25, 2016
·
2.718K
· chrisjaure

Deploy Node.js apps with Haibu and Git

Git Set-Up

Make a bare git repo on your server. I follow these instructions. Add this post-receive hook.

Deploy Set-Up

Install node and haibu. Start haibu. Drop deploy.js somewhere. Edit the paths to node, haibu, and your repo. Update the path to deploy.js in your post-receive hook.

Push with git on your local machine to your server. Done!

3 Responses
Add your response

732

Cool! Thanks man! One ever-so-slightly confusing bit for me was:

url: "/path/to/repo/"+package.name+".git"

which I would change to:

url: "/path/to/folder/containing/repos/"+package.name+".git"

over 1 year ago ·
762

@bennlich: Thanks, nice catch :) I've updated the gist.

over 1 year ago ·
3203

I've run into an issue where pushing a broken version of code is unfixable with future pushes. Have you ever come across this? I accidentally pushed code where I require() a missing library, but haibu is refusing to use newer versions of the code. I'm trying to figure out if this is a problem with haibu or the deploy script.

(I commented on what seems like a related issue here: https://github.com/nodejitsu/haibu/issues/108)

over 1 year ago ·