2020-06-03 17:36:05 +03:00
|
|
|
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
parameters:
|
2020-06-09 09:45:58 +03:00
|
|
|
success-message: '\"$(Agent.JobName) passed: $COMMIT_LINK\"'
|
2020-06-03 17:36:05 +03:00
|
|
|
|
|
|
|
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
|
2020-06-14 23:52:57 +03:00
|
|
|
MESSAGE="\":fire: :fire: <!here> :fire: :fire:\n$(Agent.JobName) *FAILED*: $COMMIT_LINK\n:fire: :fire:\""
|
2020-06-03 17:36:05 +03:00
|
|
|
else
|
2020-06-09 09:45:58 +03:00
|
|
|
MESSAGE="${{ parameters['success-message'] }}"
|
2020-06-03 17:36:05 +03:00
|
|
|
fi
|
2020-06-09 09:45:58 +03:00
|
|
|
PAYLOAD="{\"text\":$MESSAGE}"
|
|
|
|
echo curl -XPOST \
|
|
|
|
-i \
|
|
|
|
-H 'Content-type: application/json' \
|
|
|
|
--data "$PAYLOAD" \
|
|
|
|
Slack.team-daml
|
2020-06-04 13:41:36 +03:00
|
|
|
if [ "$(Build.SourceBranchName)" = "master" ]; then
|
2020-06-03 17:36:05 +03:00
|
|
|
curl -XPOST \
|
|
|
|
-i \
|
|
|
|
-H 'Content-type: application/json' \
|
|
|
|
--data "$PAYLOAD" \
|
|
|
|
$(Slack.team-daml)
|
|
|
|
fi
|
|
|
|
displayName: report
|
|
|
|
condition: always()
|