Skip to content
This repository was archived by the owner on Mar 18, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tasks/deploy/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ module.exports = function (grunt) {
grunt.log.writeln('Publishing release "%s"', grunt.shipit.releasePath);

grunt.shipit.currentPath = path.join(grunt.shipit.config.deployTo, 'current');
var relativeReleasePath = path.join('releases', grunt.shipit.releaseDirname);

grunt.shipit.remote('ln -nfs ' + grunt.shipit.releasePath + ' ' + grunt.shipit.currentPath,
grunt.shipit.remote('cd ' + grunt.shipit.config.deployTo + ' && ln -nfs ' + relativeReleasePath + ' current',
function (err) {
if (err) return cb(err);
grunt.log.oklns('Release published.');
Expand Down
4 changes: 2 additions & 2 deletions test/unit/tasks/deploy/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('deploy:publish task', function () {
});

shipit.releasePath = '/remote/deploy/releases/20141704123138';
shipit.releaseDirname = '20141704123138';

sinon.stub(shipit, 'remote').yields();
});
Expand All @@ -36,8 +37,7 @@ describe('deploy:publish task', function () {
runTask('deploy:publish', function (err) {
if (err) return done(err);
expect(shipit.currentPath).to.equal('/remote/deploy/current');
expect(shipit.remote).to.be.calledWith('ln -nfs /remote/deploy/releases/20141704123138 ' +
'/remote/deploy/current');
expect(shipit.remote).to.be.calledWith('cd /remote/deploy && ln -nfs releases/20141704123138 current');
done();
});
});
Expand Down