mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
1300644668
When I changed the quoting for the success case as part of #6267, I forgot to update the error case, so now we don't get well-formed JSON for errors. CHANGELOG_BEGIN CHANGELOG_END
33 lines
1.1 KiB
YAML
33 lines
1.1 KiB
YAML
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
parameters:
|
|
success-message: '\"$(Agent.JobName) passed: $COMMIT_LINK\"'
|
|
|
|
steps:
|
|
- bash: |
|
|
set -euo pipefail
|
|
eval "$(dev-env/bin/dade assist)"
|
|
COMMIT_TITLE=$(git log --pretty=format:%s -n1)
|
|
COMMIT_LINK="<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|$COMMIT_TITLE>"
|
|
if [ "$(Agent.JobStatus)" != "Succeeded" ]; then
|
|
MESSAGE="\":fire: :fire: <!here> :fire: :fire:\n$(Agent.JobName) *FAILED*: $COMMIT_LINK\n:fire: :fire:\""
|
|
else
|
|
MESSAGE="${{ parameters['success-message'] }}"
|
|
fi
|
|
PAYLOAD="{\"text\":$MESSAGE}"
|
|
echo curl -XPOST \
|
|
-i \
|
|
-H 'Content-type: application/json' \
|
|
--data "$PAYLOAD" \
|
|
Slack.team-daml
|
|
if [ "$(Build.SourceBranchName)" = "master" ]; then
|
|
curl -XPOST \
|
|
-i \
|
|
-H 'Content-type: application/json' \
|
|
--data "$PAYLOAD" \
|
|
$(Slack.team-daml)
|
|
fi
|
|
displayName: report
|
|
condition: always()
|