1

Our project is in this format

Our project is in this format after using sfdx force:mdapi:convert -r src it converted to this which doesnt have package.xml

after using sfdx force:mdapi:convert -r src it converted to this which doesnt have package.xml Using sfdx force:source:convert converted project to this format with package.xml Using sfdx force:source:convert converted project to this format with package.xml

Still not sure how this package.xml should be avoided to achieve partial deployment

I need a way to deploy salesforce changes using SFDX without package.xml for continuous integration and delivery, we use custom build system instead of Jenkins and not able to find an example of build.xml with ANT to deploy changes using SFDX while building, please help. How to perform SFDX commands like below while building using build.xml is it possible?

sfdx force:mdapi:retrieve -r ./mdAPIZip -u jzaa1 -k src/package.xml

sfdx force:mdapi:deploy -c -f ../mdAPIZip/unpackaged.zip -u jzaa1 -w 10
  • Your original question was about deploying using SFDX. Now your root question seems to be about performing partial deployments, and it's not clear what you really need. Please tell us more about your overall objective to help understand your proposed solution. – David Reed Oct 23 '19 at 16:47
  • Main objective is to achieve partial deployments and CICD, while reading about this i found SFDX and thought SFDX would automatically determine changes and deploy without need of Package.xml hence was the question, apologies for the confusion, any suggestions on how to do partial deployments with CI CD? @DavidReed – nothingisimpossible Oct 23 '19 at 18:47
4

The Ant-based Force.com Migration Tool and SFDX CLI are both clients of the Metadata API. You need one or the other, but generally not both, as both tools provide Metadata API deployment services. Specifically, you don't need the Force.com Migration Tool to drive Salesforce DX. You can issue commands like sfdx force:mdapi:deploy directly via a shell script or your build system's configuration interface.

As to package.xml: if you're using Metadata API-format source code (typically in a src folder) and not SFDX-format source code (typically in a force-app folder), you'll need a package.xml manifest.

If you're using SFDX-format code, you may not need a manifest. SFDX's force:source commands (such as push, for scratch orgs, and deploy, for non-scratch orgs) don't require a manifest. Likewise, converting your SFDX-format source to MDAPI-format source via force:source:convert will create a manifest for you to make the result deployable using the Metadata API, via the force:mdapi:deploy command. (Note that if you're practicing the Org Development Model, without using source-tracking scratch orgs, you'll likely also have a package.xml under the manifest directory).

If you aren't familiar with the two source formats and aren't currently using Salesforce DX, your code is certainly in Metadata API format and does require a manifest for deployment.

Salesforce provides documentation covering CI setup on various providers, including sample repos. I wrote a series of blog posts on setting up SFDX-based CI using CircleCI some time ago.

Partial Deployments

Partial deployments are a completely separate issue from the above.

Salesforce's tooling does not include any support for partial or delta (i.e., change-only) deployments other than with source-tracking orgs (such as scratch orgs), where you can use sfdx force:source:push.

If you're deploying to sandboxes or production, you'll have to write your own scripts to generate a package.xml representing some arbitrary set of changes that you wish to deploy separately. There's not a single standard way to do that; it will depend on the whole scope of your tool chain and development process.

You do not have to use partial deployments to implement CI and CD. Unless your application is truly enormous, you can deploy the entire application to your persistent environments.

| improve this answer | |
  • 1
    Thanks a ton for reply, we are not not using salesforceDX yet , we are planning to use it by converting existing one to DX, do you have any examples of shell scripts and build.xml to perform sfdx commands? Ant had simple targets like below is there any example for SFDX where i can start. <target name="deployCodeDev"> <sf:deploy username="${sfTarget.username}" password="${sfTarget.password}" serverurl="${sfTarget.serverurl}" deployroot="src" rollbackOnError="false" allowMissingFiles="true" singlePackage="true"/> </target> – nothingisimpossible Sep 13 '19 at 7:28
  • I've added some relevant links, @nothingisimpossible, – David Reed Sep 14 '19 at 1:46
  • @aoristdual I have converted entire project to SFDX why am i still getting below error? Error force-app/package.xml package.xml No package.xml found – nothingisimpossible Oct 17 '19 at 18:06
  • @nothingisimpossible Are you trying to deploy Salesforce DX format source code using a Metadata API client? – David Reed Oct 18 '19 at 17:08
  • Yes, im still confused why there is a dependency on package.xml @aoristdual – nothingisimpossible Oct 18 '19 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.