From 960a3086e7708d6accdc2685f8383f5ffe3c1c7f Mon Sep 17 00:00:00 2001 From: bjoern Date: Fri, 15 Jan 2016 21:39:42 +0100 Subject: [PATCH 1/2] Update cp parameter for non ntfs compatibility * parameter -a is only available on ntfs filesystems * changed parameter to -r which is available everywhere * works on OSX now with HFS+ --- tasks/deploy/update.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/deploy/update.js b/tasks/deploy/update.js index 4f7579b..73b06b7 100644 --- a/tasks/deploy/update.js +++ b/tasks/deploy/update.js @@ -42,7 +42,7 @@ module.exports = function (gruntOrShipit) { return Promise.resolve(); } shipit.log('Copy previous release to "%s"', shipit.releasePath); - return shipit.remote(util.format('cp -a %s/. %s', path.join(shipit.releasesPath, shipit.previousRelease), shipit.releasePath)); + return shipit.remote(util.format('cp -r %s/. %s', path.join(shipit.releasesPath, shipit.previousRelease), shipit.releasePath)); } /** From 752c1fb3268fd1d9a401a42b555610e2f6a739fc Mon Sep 17 00:00:00 2001 From: bjoern Date: Mon, 1 Feb 2016 21:08:54 +0100 Subject: [PATCH 2/2] Add cp parameter to shipit options * defaults to '-a' * update readme --- README.md | 6 ++++++ tasks/deploy/update.js | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0295170..6d515d5 100755 --- a/README.md +++ b/README.md @@ -128,6 +128,12 @@ Type: `String` Log format to pass to [`git log`](http://git-scm.com/docs/git-log#_pretty_formats). Used to display revision diffs in `pending` task. Default: `%h: %s - %an`. +### copy + +Type: `String` + +Parameter to pass to `cp` to copy the previous release. Non NTFS filesystems support `-r`. Default: `-a` + ## Variables Several variables are attached during the deploy and the rollback process: diff --git a/tasks/deploy/update.js b/tasks/deploy/update.js index 73b06b7..edaa45a 100644 --- a/tasks/deploy/update.js +++ b/tasks/deploy/update.js @@ -38,11 +38,12 @@ module.exports = function (gruntOrShipit) { */ function copyPreviousRelease() { + var copyParameter = shipit.config.copy || '-a'; if (!shipit.previousRelease) { return Promise.resolve(); } shipit.log('Copy previous release to "%s"', shipit.releasePath); - return shipit.remote(util.format('cp -r %s/. %s', path.join(shipit.releasesPath, shipit.previousRelease), shipit.releasePath)); + return shipit.remote(util.format('cp %s %s/. %s', copyParameter, path.join(shipit.releasesPath, shipit.previousRelease), shipit.releasePath)); } /**