Currently only supports files saved via the legacy mdapi file structure (./src/apex ... etc.). If you are using the SFDX package structure, please reference the SFDX CLI.
CLI Tool to generate Salesforce.com package.xml (and destructiveChange.xml) files based on git diff between two branches.
Note: TargetBranch is the branch to which you want to bring up to speed (i.e. sourceBranch changes go into targetBranch)
If any deletes occurred will also create ./deployFolder/packageName/destructive/destructiveChanges.xml
git clone https://github.com/dcinzona/sf-packager.git && cd sf-packager && npm link
$ sfpackage since '1 day ago' targetBranch sourceBranch ./deploy/ packageName
This will create a package at ./deploy/sourceBranch/unpackaged/package.xml copying all files into directory. Note: the files copied are copied from your current branch so it is recommended sourceBranch be whatever branch you are on
- SourceBranch is optional and will default to your current branch
$ sfpackage since yesterday targetBranch -f ./deploy -p myDeploymentName
$ sfpackage since yesterday targetBranch -f ./customFolder -p packageName
$ sfpackage since yesterday targetBranch sourceBranch ./customFolder packageName
$ sfpackage latest targetBranch sourceBranch ./deploy/ packageName
This will create a package at ./deploy/sourceBranch/unpackaged/package.xml copying all files into directory.
Note: the files copied are copied from your current branch so it is recommended sourceBranch be whatever branch you are on
- SourceBranch is optional and will default to your current branch
You can also just write out the package.xml and destructiveChanges.xml by passing the -d flag
sfpackage latest targetBranch sourceBranch -d > ~/Desktop/packageAndDestructiveChanges.xml
You can also create "backout" content by reversing the order of the destination and source branches
sfpackage latest sourceBranch targetBranch ./deploy/ packageName
sfpackage latest HEAD~3
--folder
or -f
will default to ./deploy/
when no variable is passed in after the flag
- Add support for specifying tags / labels and branches
- Add support to deploy the package to an environment
- Requires Ant
- Add method to create an env config for Ant to process
- Add support for JWT bearer token deployments