Last Updated: February 25, 2016
·
2.919K
· 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!

Written by Chris Jaure

Recommend
Say Thanks
Update Notifications Off
Respond

3 Responses
Add your response

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 ·

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

over 1 year ago ·

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 ·