Permalink
Browse files

Reordered deploy chain. Removed hard coded remote.

  • Loading branch information...
1 parent 62dcfb6 commit 2a6e56112560f37f3711097d98354cef1a6eb66a @bengourley committed Dec 14, 2011
Showing with 21 additions and 20 deletions.
  1. +1 −1 README.md
  2. +20 −19 lib/index.js
View
@@ -74,7 +74,7 @@ var share = {}, // Shared info between the
* are its dependencies being called in order.
*/
desc('Deploy the current branch to the live environment');
-task('deploylive', ['setenvlive', 'launch:installdeps', 'restart'], function () {
+task('deploylive', ['setenvlive', 'launch:symlink', 'restart'], function () {
});
/*
View
@@ -6,22 +6,6 @@ module.exports = function (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');
task('symlink', ['launch:linklast'], function () {
@@ -62,7 +46,7 @@ module.exports = function (share) {
desc('Remove archived deployment');
- task('rmarchive', ['launch:putremote'], function () {
+ task('rmarchive', ['launch:installdeps'], function () {
var env = share.env ? share.env + '/' : '';
share.linkpath = share.info.remotepath + env;
@@ -89,12 +73,29 @@ module.exports = function (share) {
}, 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');
task('putremote', ['launch:checkout'], function () {
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();
- action.local('rsync -arvz ' + share.tempdir + ' rubble:'
+ action.local('rsync -arvz ' + share.tempdir + ' ' + share.info.remote + ':'
+ share.payload, function (exitcode) {
if (exitcode === 0) {
action.success('Repo contents put to remote');

0 comments on commit 2a6e561

Please sign in to comment.