diff --git a/README.md b/README.md index e44702c9..61a14eba 100755 --- a/README.md +++ b/README.md @@ -36,11 +36,11 @@ Commands: info Show describe information from a remote package Generate a package.xml file from local describe information retrieve Retrieve metadata specified in package.xml + deploy Deploy metadata specified in a package.xml + deployTest DEPRECATED! Use `deploy -t` instead + validate DEPRECATED! Use `deploy -c` instead + validateTest DEPRECATED! Use `deploy -ct` instead test Execute unit tests - validate Validate metadata deployment - validateTest Validate metadata deployment and run local unit tests - deploy Deploy metadata - deployTest Deploy metadata and run local unit tests changeset Create a changeset/deployment from a unified diff input or cli args query Execute a SOQL query returing JSON bulk (alpha) Import/export data in CSV format using the bulk API diff --git a/bin/cli b/bin/cli index f9f93ade..7cb82343 100755 --- a/bin/cli +++ b/bin/cli @@ -28,12 +28,12 @@ var doc = "force-dev-tool.\n" + " fetch Fetch describe information from a remote\n" + " info Show describe information from a remote\n" + " package Generate a package.xml file from local describe information\n" + - " retrieve Retrieve metadata specified in package.xml\n" + + " retrieve Retrieve metadata specified in a package.xml\n" + + " deploy Deploy metadata specified in a package.xml\n" + + " deployTest DEPRECATED! Use `deploy -t` instead\n" + + " validate DEPRECATED! Use `deploy -c` instead\n" + + " validateTest DEPRECATED! Use `deploy -ct` instead\n" + " test Execute unit tests\n" + - " validate Validate metadata deployment\n" + - " validateTest Validate metadata deployment and run local unit tests\n" + - " deploy Deploy metadata\n" + - " deployTest Deploy metadata and run local unit tests\n" + " changeset Create a changeset/deployment from a unified diff input or cli args\n" + " query Execute a SOQL query returing JSON\n" + " bulk (alpha) Import/export data in CSV format using the bulk API\n" + diff --git a/lib/cli/deployTest.js b/lib/cli/deployTest.js index 5849757c..57e8ec54 100755 --- a/lib/cli/deployTest.js +++ b/lib/cli/deployTest.js @@ -5,19 +5,27 @@ var DeployCommand = require('./deploy'); var doc = "Usage:\n" + " force-dev-tool deployTest [options] []\n" + "\n" + + "DEPRECATED! Use `deploy --test` (or short `deploy -t`) instead.\n" + + "\n" + "Options:\n" + - " -d= Directory containing the metadata and package.xml.\n" + - " -f= Zip file containing the metadata and package.xml."; + " -c --checkOnly Perform a test deployment (validation).\n" + + " --runTests= Names of test classes (one argument, separated by whitespace).\n" + + " --runAllTests Run all tests including tests of managed packages.\n" + + " --purgeOnDelete Don't store deleted components in the recycle bin.\n" + + " -d= Directory to be deployed [default: src].\n" + + " -f= Zip file to be deployed."; -var Subcommand = module.exports = function(project) { +var SubCommand = module.exports = function(project) { var self = this; DeployCommand.call(self, project, doc); - self.action = "Deployment with test execution"; - self.deployOpts = { - rollbackOnError: true, - testLevel: 'RunLocalTests' - }; }; -Subcommand.prototype = Object.create(DeployCommand.prototype); -Subcommand.prototype.constructor = Subcommand; +SubCommand.prototype = Object.create(DeployCommand.prototype); +SubCommand.prototype.constructor = SubCommand; + +SubCommand.prototype.process = function(proc, callback) { + var self = this; + self.opts = self.docopt(); + self.opts['--test'] = true; + return DeployCommand.prototype.process.call(self, proc, callback); +}; diff --git a/lib/cli/validate.js b/lib/cli/validate.js index a3d232fd..418e32ef 100755 --- a/lib/cli/validate.js +++ b/lib/cli/validate.js @@ -5,19 +5,27 @@ var DeployCommand = require('./deploy'); var doc = "Usage:\n" + " force-dev-tool validate [options] []\n" + "\n" + + "DEPRECATED! Use `deploy --checkOnly` (or short `deploy -c`) instead.\n" + + "\n" + "Options:\n" + - " -d= Directory containing the metadata and package.xml.\n" + - " -f= Zip file containing the metadata and package.xml."; + " -t --test Run local tests.\n" + + " --runTests= Names of test classes (one argument, separated by whitespace).\n" + + " --runAllTests Run all tests including tests of managed packages.\n" + + " --purgeOnDelete Don't store deleted components in the recycle bin.\n" + + " -d= Directory to be deployed [default: src].\n" + + " -f= Zip file to be deployed."; var SubCommand = module.exports = function(project) { var self = this; DeployCommand.call(self, project, doc); - self.action = "Validation"; - self.deployOpts = { - rollbackOnError: true, - checkOnly: true - }; }; SubCommand.prototype = Object.create(DeployCommand.prototype); SubCommand.prototype.constructor = SubCommand; + +SubCommand.prototype.process = function(proc, callback) { + var self = this; + self.opts = self.docopt(); + self.opts['--checkOnly'] = true; + return DeployCommand.prototype.process.call(self, proc, callback); +}; diff --git a/lib/cli/validateTest.js b/lib/cli/validateTest.js index 2aab67c9..78173739 100755 --- a/lib/cli/validateTest.js +++ b/lib/cli/validateTest.js @@ -5,20 +5,27 @@ var DeployCommand = require('./deploy'); var doc = "Usage:\n" + " force-dev-tool validateTest [options] []\n" + "\n" + + "DEPRECATED! Use `deploy --checkOnly --test` (or short `deploy -ct`) instead.\n" + + "\n" + "Options:\n" + - " -d= Directory containing the metadata and package.xml.\n" + - " -f= Zip file containing the metadata and package.xml."; + " --runTests= Names of test classes (one argument, separated by whitespace).\n" + + " --runAllTests Run all tests including tests of managed packages.\n" + + " --purgeOnDelete Don't store deleted components in the recycle bin.\n" + + " -d= Directory to be deployed [default: src].\n" + + " -f= Zip file to be deployed."; var SubCommand = module.exports = function(project) { var self = this; DeployCommand.call(self, project, doc); - self.action = "Validation with test execution"; - self.deployOpts = { - rollbackOnError: true, - checkOnly: true, - testLevel: 'RunLocalTests' - }; }; SubCommand.prototype = Object.create(DeployCommand.prototype); SubCommand.prototype.constructor = SubCommand; + +SubCommand.prototype.process = function(proc, callback) { + var self = this; + self.opts = self.docopt(); + self.opts['--checkOnly'] = true; + self.opts['--test'] = true; + return DeployCommand.prototype.process.call(self, proc, callback); +};