force-source-deploy Task

Description

Deploys metadata in source format to an org.

It executes the force:source:deploy command.

Parameters

In addition to the attributes used by every ant-sfdx task, this task uses the following attributes:

Attribute Command line equivalent Description Required
checkonly -c When set to true, validates the deployed metadata and runs all Apex tests but prevents the deployment from being saved to the org. No; defaults to false.
ignoreerrors -o When set to true, ignores the deploy errors, and continues with the deploy operation. No; defaults to false.
ignorewarnings -g When set to true, the success field in DeployMessage is true even if a warning occurs. When set to false and a warning occurs success is set to false, and the warning is treated like an error. No; defaults to false.
manifest -x The path for the manifest (package.xml) file that specifies the components to deploy. No.
sourcepath -p The path to the local source file (or directory) to deploy. No
targetusername -u A username or alias for the target org. No
testlevel -l Specifies which tests to run. Acceptable values are:
  • NoTestRun: no tests are run
  • RunAllTestsInOrg: all tests in your org and in installed managed packages are run.
  • RunLocalTests: all tests in your org are run, except the ones that originate from installed managed packages.
  • RunSpecifiedTests: only the tests that you specify are run.
No
validateddeployrequestid -q Specifies the ID of a package with recently validated components to run a Quick Deploy. No.
wait -w The streaming client socket timeout, in minutes. No; defaults to 33.

Parameters specified as nested elements

metadata

Specifies the name of a metadata component to deploy to the org.

sourcepath

The sourcepath attribute is a path-like structure and can also be set via a nested <sourcepath> element.

runtests

Specifies an Apex test class name to run.

Examples

<sfdx:force-source-deploy targetusername="scratchorg" sourcepath="force-app/main/default/objects/Case">
  <sourcepath>
    <pathelement location="force-app/main/default/objects/Contact" />
    <dirset dir="force-app/main/default/objects">
      <include name="Ac*" />
    </dirset>
  </sourcepath>
</sfdx:sfdx:force-source-deploy>

Version: 0.0.0-master