Skip to content
This repository has been archived by the owner on Mar 18, 2018. It is now read-only.

Commit

Permalink
Allow passing options remoteCopy via config.deploy.remoteCopy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Kelty committed Jul 1, 2016
1 parent ba9bb94 commit ff5489a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks/deploy/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ module.exports = function (gruntOrShipit) {

function remoteCopy() {
var uploadDirPath = path.resolve(shipit.config.workspace, shipit.config.dirToCopy || '');
var options = _.get(shipit.config, 'deploy.remoteCopy') || {rsync: '--del'};

shipit.log('Copy project to remote servers.');
return shipit.remoteCopy(uploadDirPath + '/', shipit.releasePath, {rsync: '--del'})

return shipit.remoteCopy(uploadDirPath + '/', shipit.releasePath, options)
.then(function () {
shipit.log(chalk.green('Finished copy.'));
});
Expand Down
17 changes: 17 additions & 0 deletions test/unit/tasks/deploy/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,23 @@ describe('deploy:update task', function () {
})
});

describe('remoteCopy option', function () {
it('should accept rsync options', function () {
return new Promise(function (resolve, reject) {
var shipit = stubShipit(createShipitInstance({
deploy: {remoteCopy: {rsync: '--foo'}}
}));
shipit.start('deploy:update', function (err) {
if (err) reject(err);
var dirName = moment.utc().format('YYYYMMDDHHmmss');
expect(shipit.remoteCopy).to.be.calledWith('/tmp/workspace/', '/remote/deploy/releases/' + dirName, {rsync: '--foo'});
clock.tick(5);
resolve()
})
});
})
});

});

describe('#setPreviousRevision', function () {
Expand Down

4 comments on commit ff5489a

@antoniomadonna
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, any chance to see this released ?

Thank you!

@timkelty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So sorry @antoniomadonna, I'll get on it!

@timkelty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Released in 2.3.0

@antoniomadonna
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Please sign in to comment.