hardis:project:deploy:notify
Description
Post notifications related to:
- Deployment simulation (use with --check-only)
- Deployment process (to call only if your deployment is successful)
Integrations
According to the integrations you configured, notifications can contain deployment information and Flow Visual Git Diff
- GitHub, Gitlab, Azure DevOps, Bitbucket comments on Pull Requests (including Flows Visual Git Diff)
- Slack, Microsoft Teams, Email deployment summary after a successful deployment
- JIRA tags and comments on tickets that just has been deployed
Flows Visual Git Diff
- Visually show you the differences on a diagram
- Display the update details without having to open any XML !
🟩 = added
🟥 = removed
🟧 = updated
In custom CI/CD workflow
Example of usage in a custom CI/CD pipeline:
# Disable exit-on-error temporarily
set +e
# Run the deploy command
sf project deploy start [....]
RET_CODE=$?
# Re-enable exit-on-error
set -e
# Determine MYSTATUS based on return code
if [ $RET_CODE -eq 0 ]; then
MYSTATUS="valid"
else
MYSTATUS="invalid"
fi
# Run the notify command with MYSTATUS
sf hardis:project:deploy:notify --check-only --deploy-status "$MYSTATUS"
Other usages
This command is for custom SF Cli pipelines, if you are a sfdx-hardis user, it is already embedded in sf hardis:deploy:smart.
You can also use sfdx-hardis wrapper commands of SF deployment commands
Parameters
Name | Type | Description | Default | Required | Options |
---|---|---|---|---|---|
check-only -c |
boolean | Use this option to send notifications from a Deployment simulation job | |||
debug -d |
boolean | Activate debug mode (more logs) | |||
deploy-status -s |
option | Send success, failure or unknown (default) to indicate if the deployment or deployment simulation is in success or not | unknown | valid invalid unknown |
|
flags-dir | option | undefined | |||
json | boolean | Format output as json. | |||
message -m |
option | Custom message that you want to be added in notifications (string or markdown format) | |||
skipauth | boolean | Skip authentication check when a default username is required | |||
target-org -o |
option | undefined | |||
websocket | option | Websocket host:port for VsCode SFDX Hardis UI integration |
Examples
$ sf hardis:project:deploy:notify --check-only --deploy-status valid --message "This deployment check is valid\n\nYahooo !!"
$ sf hardis:project:deploy:notify --check-only --deploy-status invalid --message "This deployment check has failed !\n\Oh no !!"
$ sf hardis:project:deploy:notify --deploy-status valid --message "This deployment has been processed !\n\nYahooo !!"