Last active
December 29, 2015 11:42
-
-
Save manjeettahkur/a9336d89ac7dfd8ad118 to your computer and use it in GitHub Desktop.
Manu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.therightcode.net/deploy-nodejs-application-using-shipit/ | |
// sudo npm i shipit-cli -g | |
// npm i shipit-deploy --save-dev | |
// npm i shipit-npm --save-dev | |
module.exports = function (shipit) { | |
require('shipit-deploy')(shipit); // remote deploy | |
require('shipit-npm')(shipit); // remote auto install npm packages | |
var config = { | |
default: { | |
workspace: '/tmp/project-name-in-deploy-server', | |
deployTo: '/usr/src/project-name-in-deploy-server', | |
repositoryUrl: 'your git remote url (github, bitbucket, etc...)', | |
ignores: ['.git', 'node_modules'], | |
keepReleases: 2, | |
}, | |
staging: { | |
servers: 'deploy@your-deploy-server-ip' | |
} | |
}; | |
shipit.initConfig(config); | |
var current = config.default.deployTo + '/current'; | |
// shipit will put the source code in to current folder | |
shipit.task('server-on', function() { | |
return shipit.remote('cd ' + current + ' && bower i && npm start'); | |
}); | |
shipit.task('start', function() { | |
shipit.start(['deploy', 'server-on']); | |
}); | |
}; | |
// run `shipit staging start` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment