Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Deploying to Nodejitsu

Reza Akhavan edited this page Feb 2, 2014 · 7 revisions

The following guide has been tested on Mac OS 10.9

1. Create an account at Nodejitsu


2. Install nodejitsu

Run the following command in your shell ( More detailed instructions here )

sudo npm install jitsu -g

3. Install and prime for deployment

In your shell type the following commands.

git clone https://github.com/jedireza/drywall.git
cd drywall
mv ./config.example.js ./config.js
touch .npmignore
jitsu login

Enter user credentials to authenticate your terminal.

Open up the package.json file in your text editor. It should look similar to what is shown below. Follow the comments.

{
  "name": "yourprojectname", //enter name of your project
  "version": "0.6.0-14",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "async": "0.2.x",
    "connect-mongo": "0.4.x",
    "emailjs": "0.3.x",
    "express": "3.4.x",
    "jade": "1.1.x",
    "mongoose": "3.8.x",
    "passport": "0.2.x",
    "passport-local": "0.1.x",
    "passport-oauth": "1.0.x",
    "passport-facebook": "1.0.x",
    "passport-github": "0.1.x",
    "passport-twitter": "1.0.x",
    "helmet": "0.1.x",
    "bcrypt": "0.7.x"
  },
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-uglify": "~0.3.1",
    "grunt-contrib-jshint": "~0.8.0",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-watch": "~0.5.3",
    "grunt-contrib-less": "~0.9.0",
    "grunt-concurrent": "~0.4.1",
    "grunt-nodemon": "~0.2.0",
    "grunt-newer": "~0.6.0",
    "grunt-contrib-copy": "~0.5.0"
  },
// add the following properties below
  "bundledDependencies":[
    "drywall-sendmail",
    "drywall-slugify",
    "drywall-workflow"
  ],
  "subdomain": "yoursubdomain", //will be hosted as yoursubdomain.jit.su
  "domains": [ //optional domains that you own for DNS configuration
    "www.yourdomain.org",
    "yourdomain.org"
  ],
  "engines": {
    "node": "0.10.x",
    "npm": "*"
  }
}

4. Configure a remote database

  • Create an account at MongoHQ or Mongolab (or another MongoDB provider)
  • Create a database
  • Create a user with write access
  • Open the config.js file in your drywall directory
  • On line 5, change 'localhost/drywall' to the URI of your remote mongodb. It should look something like this:
uri: process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://<dbuser>:<dbpassword>@<database>.<mongohost.com>:<port>/<dbname>'

5. Deploy

Now your project is ready to deploy. In your shell, type:

jitsu deploy

To set up admin privileges to your database, use instructions provided by your database host to access your database remotely, and run the same commands given in the drywall readme.md.