hardisgroupcom / sfdx-hardis

Swiss-army-knife Toolbox for Salesforce. Orchestrates base commands and assist users with interactive wizards to make much more than native sfdx + Allows you to define a complete CI/CD Pipeline and Schedule a daily Metadata backup & monitoring of your orgs
https://sfdx-hardis.cloudity.com
GNU Affero General Public License v3.0
169 stars 29 forks source link

commandsPreDeploy & commandsPostDeploy #623

Closed nvuillam closed 3 weeks ago

nvuillam commented 3 weeks ago

Deployment pre or post commands

You can define command lines to run before or after a deployment

If the commands are not the same depending on the target org, you can define them into config/branches/.sfdx-hardis-BRANCHNAME.yml instead of root config/.sfdx-hardis.yml

Example:

commandsPreDeploy:
  - id: knowledgeUnassign
    label: Remove KnowledgeUser right to the user who has it
    command: sf data update record --sobject User --where "UserPermissionsKnowledgeUser='true'" --values "UserPermissionsKnowledgeUser='false'" --json
  - id: knowledgeAssign
    label: Assign Knowledge user to the deployment user
    command: sf data update record --sobject User --where "Username='deploy.github@myclient.com'" --values "UserPermissionsKnowledgeUser='true'" --json
commandsPostDeploy:
  - id: knowledgeUnassign
    label: Remove KnowledgeUser right to the user who has it
    command: sf data update record --sobject User --where "UserPermissionsKnowledgeUser='true'" --values "UserPermissionsKnowledgeUser='false'" --json
  - id: knowledgeAssign
    label: Assign Knowledge user to desired username
    command: sf data update record --sobject User --where "Username='admin-yser@myclient.com'" --values "UserPermissionsKnowledgeUser='true'" --json
github-actions[bot] commented 3 weeks ago

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 8 0 0.27s
✅ COPYPASTE jscpd yes no 14.94s
✅ DOCKERFILE hadolint 1 0 0.17s
✅ JSON npm-package-json-lint yes no 0.48s
✅ JSON prettier 21 1 0 1.78s
✅ JSON v8r 21 0 25.29s
⚠️ MARKDOWN markdownlint 148 0 1852 111.92s
✅ MARKDOWN markdown-table-formatter 148 0 0 0.68s
✅ REPOSITORY checkov yes no 21.09s
⚠️ REPOSITORY gitleaks yes 10 16.45s
⚠️ REPOSITORY grype yes 1 12.6s
✅ REPOSITORY trivy yes no 6.85s
✅ REPOSITORY trivy-sbom yes no 4.85s
✅ REPOSITORY trufflehog yes no 5.42s
✅ SPELL cspell 352 0 24.69s
✅ SPELL lychee 184 0 3.1s
✅ TYPESCRIPT eslint 152 0 0 9.11s
✅ TYPESCRIPT prettier 152 0 0 8.91s
✅ XML xmllint 4 0 0 0.2s
✅ YAML prettier 13 0 0 1.42s
✅ YAML v8r 13 0 28.65s
✅ YAML yamllint 13 0 0.54s

See detailed report in MegaLinter reports

_MegaLinter is graciously provided by OX Security_