grunt-deployinator
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -5,2 +5,18 @@ var Promise = require('promise'), | ||
function deploySetup(options) { | ||
var commands; | ||
commands = [ | ||
"mkdir -p " + options.directory, | ||
'cd ' + options.directory, | ||
"git clone " + options.package.repository.url + ' .' | ||
]; | ||
if (options.buildCommands) { | ||
commands = commands.concat(options.buildCommands); | ||
} | ||
return run("ssh " + options.host + " '" + commands.join(';') + "'"); | ||
} | ||
function deployPush(options) { | ||
@@ -56,4 +72,5 @@ return tagRelease(options).then(function () { | ||
module.exports.deploySetup = deploySetup; | ||
module.exports.deployPush = deployPush; | ||
module.exports.deployPull = deployPull; | ||
module.exports.tagRelease = tagRelease; |
{ | ||
"name": "grunt-deployinator", | ||
"description": "Grunt plugin that deploys git repositories on remote servers.", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"homepage": "https://github.com/istvan-antal/grunt-deployinator", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -11,14 +11,36 @@ /* | ||
var deployinator = require('../lib/deployinator.js'); | ||
function deploySetup(options) { | ||
var pkg = grunt.file.readJSON('package.json'); | ||
options.package = pkg; | ||
if (!pkg.repository || | ||
!pkg.repository.type || | ||
pkg.repository.type !== 'git' || | ||
!pkg.repository.url) { | ||
grunt.fail.fatal('Please sepecify the repository in the package.json'); | ||
} | ||
return deployinator.deploySetup(options); | ||
} | ||
grunt.registerMultiTask('deployPull', | ||
'SSH into a server and do a pull', function() { | ||
var options = this.options(); | ||
options.increment = getVersionIncrement(); | ||
var done = this.async(); | ||
if (!options.host || !options.directory) { | ||
grunt.fail.fatal('Please sepecify a host and directory.'); | ||
} | ||
var done = this.async(); | ||
if (grunt.option('setup')) { | ||
return deploySetup(options).then(function (output) { | ||
grunt.log.writeln(output); | ||
done(); | ||
}); | ||
} | ||
options.increment = getVersionIncrement(); | ||
deployinator.deployPull(options).then(function (output) { | ||
@@ -29,3 +51,3 @@ grunt.log.writeln(output); | ||
}); | ||
grunt.registerMultiTask('deployPush', | ||
@@ -35,9 +57,9 @@ 'Push to a server to deploy', function() { | ||
options.increment = getVersionIncrement(); | ||
if (!options.remote) { | ||
grunt.fail.fatal('Please sepecify a remote.'); | ||
} | ||
var done = this.async(); | ||
deployinator.deployPush(options).then(function (output) { | ||
@@ -48,14 +70,26 @@ grunt.log.writeln(output); | ||
}); | ||
grunt.registerMultiTask('npmDeploy', | ||
'Publish an NPM module', function() { | ||
var done = this.async(); | ||
//TODO | ||
deployinator.npmDeploy().then(function (output) { | ||
grunt.log.writeln(output); | ||
done(); | ||
}); | ||
}); | ||
grunt.registerTask('tagRelease', | ||
'Creates a git tag for the release.', function() { | ||
var done = this.async(), | ||
options = this.options(); | ||
options.increment = getVersionIncrement(); | ||
deployinator.tagRelease(options).then(done); | ||
}); | ||
function getVersionIncrement() { | ||
@@ -65,9 +99,9 @@ if (grunt.option('majorRelease')) { | ||
} | ||
if (grunt.option('release')) { | ||
return 'minor'; | ||
} | ||
return 'patch'; | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17238
356