onerror: Move conditional into Python
Simplifies the shell command, which is nice since it's embedded in a
string.
@@ -251,12 +251,11 @@ onerror:
slack_webhook = config["slack_webhook"] or ""
slack_message = json.dumps({"text": f"Failed deployment {deploy_origin}."}),
+ if slack_webhook:
shell(f"""
- if [[ -n "{{slack_webhook}}" ]]; then
curl {{slack_webhook:q}} \
--header 'Content-type: application/json' \
--data-raw {{slack_message:q}} \
--fail --silent --show-error \
--include
- fi
""")
