Skip to content

Commit

Permalink
Reordered deploy chain. Removed hard coded remote.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengourley committed Dec 14, 2011
1 parent 62dcfb6 commit 2a6e561
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -74,7 +74,7 @@ var share = {}, // Shared info between the
* are its dependencies being called in order. * are its dependencies being called in order.
*/ */
desc('Deploy the current branch to the live environment'); desc('Deploy the current branch to the live environment');
task('deploylive', ['setenvlive', 'launch:installdeps', 'restart'], function () { task('deploylive', ['setenvlive', 'launch:symlink', 'restart'], function () {
}); });


/* /*
Expand Down
39 changes: 20 additions & 19 deletions lib/index.js
Expand Up @@ -6,22 +6,6 @@ module.exports = function (share) {


share = share || {}; share = share || {};


desc('Install dependencies via npm');
task('installdeps', ['launch:symlink'], function () {

action.remote(share.info.remote, 'cd ' + share.payload +
' && npm install --production', function (exitcode) {
if (exitcode === 0) {
action.success('Dependencies installed');
complete();
} else {
action.error('Failed to install dependencies');
fail();
}

});
}, true);

desc('Symlink new deployment'); desc('Symlink new deployment');
task('symlink', ['launch:linklast'], function () { task('symlink', ['launch:linklast'], function () {


Expand Down Expand Up @@ -62,7 +46,7 @@ module.exports = function (share) {




desc('Remove archived deployment'); desc('Remove archived deployment');
task('rmarchive', ['launch:putremote'], function () { task('rmarchive', ['launch:installdeps'], function () {


var env = share.env ? share.env + '/' : ''; var env = share.env ? share.env + '/' : '';
share.linkpath = share.info.remotepath + env; share.linkpath = share.info.remotepath + env;
Expand All @@ -89,12 +73,29 @@ module.exports = function (share) {


}, true); }, true);



desc('Install dependencies via npm');
task('installdeps', ['launch:putremote'], function () {

action.remote(share.info.remote, 'cd ' + share.payload +
' && npm install --production', function (exitcode) {
if (exitcode === 0) {
action.success('Dependencies installed');
complete();
} else {
action.error('Failed to install dependencies');
fail();
}

});
}, true);

desc('Put contents of repository to remote server'); desc('Put contents of repository to remote server');
task('putremote', ['launch:checkout'], function () { task('putremote', ['launch:checkout'], function () {
var env = share.env ? share.env + '/' : ''; var env = share.env ? share.env + '/' : '';
share.payload = share.info.remotepath + env + '/.payloads/' share.payload = share.info.remotepath + env + '.payloads/'
+ share.info.name + '-' + new Date().getTime(); + share.info.name + '-' + new Date().getTime();
action.local('rsync -arvz ' + share.tempdir + ' rubble:' action.local('rsync -arvz ' + share.tempdir + ' ' + share.info.remote + ':'
+ share.payload, function (exitcode) { + share.payload, function (exitcode) {
if (exitcode === 0) { if (exitcode === 0) {
action.success('Repo contents put to remote'); action.success('Repo contents put to remote');
Expand Down

0 comments on commit 2a6e561

Please sign in to comment.