0

I am looking for a way to easily deploy a nodejs app via a command line script.

I found one solution: https://github.com/Skookum/nimbus

I also heard that the whole thing can be done with git and post commit hooks.

What would people recommend?

edit: i am deploying it to my own box where i have root

3
  • Are you deploying it to a service such as Heroku or Nodejitsu or your own server setup? Commented Dec 14, 2012 at 18:25
  • 1
    my own box (well technically its linode VPS) Commented Dec 14, 2012 at 21:21
  • I've been just copying the files via scp but considering git as a better option to ignore files more easily. Commented Dec 14, 2012 at 21:24

2 Answers 2

3

You have two options on a self hosted setup.

  1. Do it all yourself

    This entails git post-receive hooks. In short you setup your production box to host a copy of your repository, on your local machine you setup a remote, let's call the remote production.

    Now when you run git push production master on your local machine, the updates are sent and the server executes the post-receive hook on your server which runs whatever you wish.

    Actions you may want are: checking out/writing the data in the repo to files/folders (the git repo on the server is stored as a bare repo); restarting your webserver; notifying you that there's been a deployment etc.

    I'd suggest reading up on it at http://git-scm.com/book/en/Customizing-Git-Git-Hooks and taking a look at a few tutorials, this one (http://ryanflorence.com/deploying-websites-with-a-tiny-git-hook/) looks prety legit.

  2. Use a service to manage it for you, http://www.deployhq.com/ is the only one that springs to mind but I'm sure there's other.

Good Luck and Happy Hacking :)

Sign up to request clarification or add additional context in comments.

Comments

-2

There is a tool called shipit.js (https://github.com/shipitjs/shipit) which allows you to perform different deployment tasks like:

  • moving code from the repo to the server
  • restarting server
  • installing node_modules
  • etc.

You create a config file, and then runs: npx shipit deploy and all tasks you specify are performed. In case of failure, it has a rollback mechanism.

There is a nice screencast about it: https://youtu.be/8PpBySjkWEM.

1 Comment

thanks for the comment, forgot about that - updated

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.