This bash script will help you launch apex scripts.
To launch the scripts, is using the command:
sfdx force:apex:execute -u <alias> -f <script.apex>
link: https://github.com/d2269/SFScripts/tree/main/bash/running_apex_scripts
Script:
My experience in implementing DevOps practices and Release management for Salesforce projects.
This bash script will help you launch apex scripts.
To launch the scripts, is using the command:
sfdx force:apex:execute -u <alias> -f <script.apex>
link: https://github.com/d2269/SFScripts/tree/main/bash/running_apex_scripts
Script:
Often, for a correct deployment, we need to know the test coverage of the apex code.
This is especially true for deployment using RunSpecifiedTests.
To do this, you can use the salesforce developer console.
But in order to give it to programmers to work, you need to get the test coverage of classes.
The SOQL query will help you with this:
To get the test coverage of classes and triggers, use 2 commands
1st (you will only get the aggregate coverage)
SOQL (with tooling API)
select ApexClassOrTrigger.Name, NumLinesUncovered, NumLinesCovered FROM ApexCodeCoverageAggregate
sfdx force:data:soql:query --query "select ApexClassOrTrigger.Name, NumLinesUncovered, NumLinesCovered FROM ApexCodeCoverageAggregate" --targetusername <alias> --usetoolingapi --resultformat csv > classes.csv
2nd (you will get the value of how many rows each method of each test class covers)
SOQL (with tooling API)
select ApexTestClass.Name, TestMethodName, ApexClassOrTrigger.Name, NumLinesUncovered, NumLinesCovered FROM ApexCodeCoverage
sfdx force:data:soql:query --query "select ApexTestClass.Name, TestMethodName, ApexClassOrTrigger.Name, NumLinesUncovered, NumLinesCovered FROM ApexCodeCoverage" --targetusername <alias> --usetoolingapi --resultformat csv > classesAandMethods.csv
New version for removing flaw from the sandbox using an array.
Added a feature: do not delete the last N versions from the active version.
GitHub:
https://github.com/d2269/SFScripts/blob/main/bash/flow/delete_flow.sh
Code BASH:
You can always view all possible connection methods in sfdx sfdx auth --help