Reputation: 15032
I have a Node.js Express app that I'm hosting on Nodejitsu. I'm already using env
switches in Express for dev
and prod
, but obviously I'm going to need to push to different dev
and prod
servers.
For Nodejitsu, pushing to these servers requires a simple jitsu deploy
, which looks to my package.json
for app and domain/subdomain information.
I'm trying to think of the best way to handle the various pushes to dev
and prod
(and/r perhaps testing
, staging
, etc. in the future) given the package.json
restriction. Clearly I would like to avoid maintaining several git repos, each with its own slightly different package.json
.
What kind of workflow would be ideal for handling this?
Upvotes: 3
Views: 532
Reputation: 4847
We are't using Jitsu, but what we do is keep a couple of different version of the confs around in a confs folder. When we go to deploy our scripts copy the appropriate conf/package.json file in to the root dir.
You may be interested in this: https://github.com/nodejitsu/jitsu/issues/134
As Małecki points out in that issue, this can be done with npm scripts. You can have a few script setup in the package.json file(s) that do the appropriate pre-deploy work.
Upvotes: 3