0.0.1 • Published 4 years ago
sfdxdelta v0.0.1
Delta-CLI
A cli plugin for the Salesforce CLI built by David Browaeys containing a lot of helpful commands.
Pre-requisite
Install SDFX CLI
Install node.js. + npm. Once installed, checkout proxy setting if you are behind corporate proxy.
Install Delta-CLI
- go to your local workspace and clone Delta-CLI repository
git clone https://github.com/davidbrowaeys/Delta.git
Go to Delta-CLI folder and install it globally using npm:
cd delta-cli sudo npm install -g .
sfdx dxb:source:delta -r delta -m tags -k mytag sfdx dxb:source:delta -r delta -m commitid -k 123456 sfdx dxb:source:delta -r delta -m branch -k origin/master
Here is an example of how to use the delta command in a pipeline JenkinsFile
def jsonSlurper = new JsonSlurper(); bat "sfdx dxb:source:delta -m branch -k master --json -r > delta.json"; stdout = readFile("delta.json").trim(); def delta = jsonSlurper.parseText(stdout); def options = ""; if (delta.testClasses != null && delta.testClasses.isEmpty() == false){ options = "-l RunSpecifiedTest -r "+ delta.testClasses.join(','); } def cmd = "sfdx force:source:deploy -p "+delta.deltaMeta.join(',')+" -u prod -w 600 "+options; bat cmd;
Another example using azure pipeline
- script: |
cd "$(System.ArtifactsDirectory)/app"
options=$(sfdx dxb:source:delta -m branch -k ${{parameters.compareWith}} -l ${{parameters.testlevel}})
echo sfdx force:source:deploy $options -u $(Environment.Name) -l ${{parameters.testlevel}} -w 600
sfdx force:source:deploy $options -u $(Environment.Name) -l ${{parameters.testlevel}} -w 600
displayName: "sfdx deploy"
0.0.1
4 years ago