2

We have constructed our app to consist of three repositories:

  1. Frontend (this one is deployed)
  2. Shared
  3. Core

These are all private Git repositories on GitHub.

The relevant part of my package.json file looks like this:

  "dependencies": {
    "express": "2.5.x",
    "coffeecup": "0.3.x",
    "socket.io": "0.8.x",
    "connect-mongodb": "1.x",
    "app-core": "git+ssh://git@github.com:...git",
    "app-shared": "git+ssh://git@github.com:...git"
  },
  "devDependencies": {
    "mongoskin": "*",
    "bcrypt": "*",
    "libxml-to-js": "0.3.x"
  },
  "bundleDependencies": [
    "app-core",
    "app-shared"
  ],
  "analyze": true

When I deploy to Nodejitsu the only way to make it work is to have Shared and Core's dependencies in devDependencies of the repository I deploy, but that seems to be the wrong solution as devDependencies is meant for development and not production.

I have also tried Shrinkwrapping but with no avail.

Does anyone know of a better solution?

webjay
  • 5,358
  • 9
  • 45
  • 62

2 Answers2

1

"bundleDependencies" should work. When you jitsu deploy, it will analyze dependencies and try to add them, but you can disable this with --noanalyze. If you have your dependencies in node_modules/app-core and node_modules/app-shared, then I don't see why it wouldn't work. Can you show me more information, like the output of jitsu deploy?

EDIT: Oh, I see, you have them in devDependencies so that they don't install on Nodejitsu. Yeah, I guess that's how it would you would do it, unless you just wanted to bundle the dependencies as submodules, and not even have them inside dependencies or devDependencies.

CodeRarity
  • 532
  • 2
  • 7
0

You can only ssh to github from your own machine.

Change the repo url from git+ssh://git@github.com... to https://github.com/...

fent
  • 17,861
  • 15
  • 87
  • 91
  • At Nodejitsu you can not have your private SSH key, so private reps can't be fetched, thus I need bundleDependencies. – webjay Mar 20 '12 at 08:03