Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
chore: remove deprecated deploy aliases
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `deploy` aliases `deployTest`, `validate` and `validateTest` have been removed.

* use `deploy -t` instead of `deployTest`
* use `deploy -c` instead of `validate`
* use `deploy -ct` instead of `validateTest`
  • Loading branch information
amtrack committed Jun 28, 2018
1 parent b10f90f commit d34c3a8
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 178 deletions.
61 changes: 49 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ Commands:
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
changeset Create a changeset/deployment from a unified diff input or cli args
query Execute a SOQL query returing JSON
Expand Down Expand Up @@ -172,16 +169,56 @@ exported metadata container to config/deployments/undo-vat
**Deploying metadata**

```console
$ force-dev-tool validate
$ force-dev-tool validateTest
$ force-dev-tool validateTest -d config/deployments/vat
$ force-dev-tool deploy
$ force-dev-tool deployTest
```
$ force-dev-tool deploy --help
Usage:
force-dev-tool deploy [options] [<remote>]

Options:
Deploy metadata specified in a package.xml.

-d=<directory> Directory containing the metadata and package.xml [default: ./src].
Options:
-c --checkOnly Perform a test deployment (validation).
-t --test Run local tests.
--runTests=<classNames> Names of test classes (one argument, separated by whitespace).
--runAllTests Run all tests including tests of managed packages.
--purgeOnDelete Don't store deleted components in the recycle bin.
--noSinglePackage Allows to deploy multiple packages.
-d=<directory> Directory to be deployed [default: src].
-f=<zipFile> Zip file to be deployed.

Examples:

Deploying the default directory to the default remote
$ force-dev-tool deploy
Running Deployment of directory src to remote mydev
Visit https://mynamespace.my.salesforce.com/changemgmt/monitorDeploymentsDetails.apexp?asyncId=REDACTED for more information.

Deploying to another remote
$ force-dev-tool deploy myqa

Deploying a specified directory
$ force-dev-tool deploy -d config/deployments/vat

Perform a test deployment (validation)
$ force-dev-tool deploy --checkOnly
$ force-dev-tool deploy -c

Deploying with running local tests
$ force-dev-tool deploy -t
$ force-dev-tool deploy --test

Deploying with running specified test classes
$ force-dev-tool deploy --runTests 'Test_MockFoo Test_MockBar'

Deploying with running test classes matching a pattern
$ force-dev-tool package grep 'ApexClass/Test_Mock*' \
| cut -d '/' -f 2 \
| xargs -0 force-dev-tool deploy --runTests

Deploying with running only test classes being contained in a deployment
$ force-dev-tool package grep 'ApexClass/Test_*' --template config/deployments/mock \
| cut -d '/' -f 2 \
| xargs -0 force-dev-tool deploy -d config/deployments/mock --runTests
```

**Running unit tests**

Expand Down Expand Up @@ -236,7 +273,7 @@ The following environment variables can be used to define a default remote envir
* `SFDC_SERVER_URL`

```console
$ force-dev-tool validateTest env
$ force-dev-tool deploy -ct env
```

Note: You can also define named remotes using [Environment Variables](https://github.com/amtrack/force-dev-tool/wiki/Environment-Variables) (e.g. `SFDC_ci_USERNAME`, `SFDC_ci_PASSWORD`, `SFDC_ci_SERVER_URL`).
Expand Down
5 changes: 1 addition & 4 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ var doc = "force-dev-tool.\n" +
" package Generate a package.xml file from local describe information\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" +
" changeset Create a changeset/deployment from a unified diff input or cli args\n" +
" query Execute a SOQL query returing JSON\n" +
Expand All @@ -48,7 +45,7 @@ var opts = docopt(doc, {
var command = opts['<command>'];
var args = opts['<args>'];
var topic = (args !== null && args.length > 0) ? args[0] : null;
var validCommands = ['remote', 'login', 'fetch', 'info', 'package', 'retrieve', 'test', 'validate', 'validateTest', 'deploy', 'deployTest', 'changeset', 'query', 'bulk', 'execute'];
var validCommands = ['remote', 'login', 'fetch', 'info', 'package', 'retrieve', 'test', 'deploy', 'changeset', 'query', 'bulk', 'execute'];

var storagePath = process.cwd();
var storagePathBestGuess = findUp.sync(path.join('src', 'package.xml'));
Expand Down
31 changes: 0 additions & 31 deletions lib/cli/deployTest.js

This file was deleted.

31 changes: 0 additions & 31 deletions lib/cli/validate.js

This file was deleted.

31 changes: 0 additions & 31 deletions lib/cli/validateTest.js

This file was deleted.

60 changes: 60 additions & 0 deletions test-integration/deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"use strict";

var assert = require("assert");
var path = require("path");
var child = require("child_process");
var tmp = require("tmp");
var Unzip = require('../lib/unzip');

describe('force-dev-tool deploy', function() {
var fdt = path.resolve(__dirname, '..', 'bin', 'cli');
it('should simulate deploying a zip file containing a layout with umlauts in the filename', function() {
this.timeout(1000 * 60 * 10);
this.slow(1000 * 60 * 5);
var deployCmd = child.spawnSync("node", [fdt, 'deploy', '-c', '-f', path.resolve(__dirname, '..', 'test', 'data', 'unpackaged', 'layout-with-umlauts.zip')]);
assert.deepEqual(deployCmd.status, 0, deployCmd.stderr);
assert(/Running Validation of zip file/.test(deployCmd.stdout.toString()));
assert(/Visit https/.test(deployCmd.stdout.toString()));
});
it('should simulate deploying a layout with umlauts in the filename', function(done) {
this.timeout(1000 * 60 * 10);
this.slow(1000 * 60 * 5);
var tmpDir = tmp.dirSync();
var testZipPath = path.join(__dirname, '..', 'test', 'data', 'unpackaged', 'layout-with-umlauts.zip');
var unzipDir = path.join(tmpDir.name, 'unzipped');
new Unzip(testZipPath).target(unzipDir, function(err) {
if (err) {
return done(err);
}
var deployCmd = child.spawnSync("node", [fdt, 'deploy', '-c', '-d', unzipDir]);
assert.deepEqual(deployCmd.status, 0, deployCmd.stderr);
assert(/Running Validation of directory/.test(deployCmd.stdout.toString()));
assert(/Visit https/.test(deployCmd.stdout.toString()));
done();
});
});
it('should simulate deploying a visualforce page', function() {
this.timeout(1000 * 60 * 10);
this.slow(1000 * 60 * 5);
var deployCmd = child.spawnSync("node", [fdt, 'deploy', '-c', '-t', '-d', path.resolve(__dirname, '..', 'test', 'data', 'metadata', 'visualforce')]);
assert.deepEqual(deployCmd.status, 0, deployCmd.stderr);
assert(/Running Validation with test execution of directory/.test(deployCmd.stdout.toString()));
assert(/Visit https/.test(deployCmd.stdout.toString()));
});
it('should simulate deploying an apex class with a test class', function() {
this.timeout(1000 * 60 * 10);
this.slow(1000 * 60 * 5);
var deployCmd = child.spawnSync("node", [fdt, 'deploy', '-c', '-t', '-d', path.resolve(__dirname, '..', 'test', 'data', 'unpackaged', 'apex')]);
assert.deepEqual(deployCmd.status, 0, deployCmd.stderr);
assert(/Running Validation with test execution of directory/.test(deployCmd.stdout.toString()));
assert(/Visit https/.test(deployCmd.stdout.toString()));
});
it('should simulate deploying an apex class with a failing test class', function() {
this.timeout(1000 * 60 * 10);
this.slow(1000 * 60 * 5);
var deployCmd = child.spawnSync("node", [fdt, 'deploy', '-c', '-t', '-d', path.resolve(__dirname, '..', 'test', 'data', 'unpackaged', 'apex-failing')]);
assert.deepEqual(deployCmd.status, 1);
assert(/Running Validation with test execution of directory/.test(deployCmd.stdout.toString()));
assert(/Error:.*failed\./.test(deployCmd.stderr.toString()));
});
});
36 changes: 0 additions & 36 deletions test-integration/validate.js

This file was deleted.

33 changes: 0 additions & 33 deletions test-integration/validateTest.js

This file was deleted.

0 comments on commit d34c3a8

Please sign in to comment.