2020-03-27 03:26:10 +03:00
|
|
|
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2020-02-06 14:54:07 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2020-04-08 14:01:42 +03:00
|
|
|
parameters:
|
|
|
|
trigger_sha: ''
|
|
|
|
|
2019-07-04 17:22:22 +03:00
|
|
|
steps:
|
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
2020-04-08 14:01:42 +03:00
|
|
|
COMMIT_TITLE=$(git log --pretty=format:%s -n1 ${{ parameters.trigger_sha }})
|
2020-04-22 16:21:04 +03:00
|
|
|
COMMIT_LINK="<https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)|$COMMIT_TITLE>"
|
2020-04-08 14:01:42 +03:00
|
|
|
if [ -z "${{ parameters.trigger_sha }}" ]; then
|
2020-04-16 18:50:55 +03:00
|
|
|
WARNING="<!here> *FAILED* $(Build.SourceBranchName)/$(Agent.JobName): $COMMIT_LINK"
|
2020-04-08 14:01:42 +03:00
|
|
|
else
|
2020-04-16 18:50:55 +03:00
|
|
|
WARNING=":fire: :fire: :fire: :fire: :fire:\n<!here> *RELEASE FAILED* $(Build.SourceBranchName)/$(Agent.JobName): $COMMIT_LINK\n:fire: :fire: :fire: :fire: :fire:"
|
2020-04-08 14:01:42 +03:00
|
|
|
fi
|
2019-07-04 17:22:22 +03:00
|
|
|
curl -XPOST \
|
|
|
|
-i \
|
|
|
|
-H 'Content-type: application/json' \
|
2020-04-08 14:01:42 +03:00
|
|
|
--data "{\"text\":\"$WARNING\n\"}" \
|
2020-02-03 18:29:13 +03:00
|
|
|
$(Slack.team-daml)
|
2020-04-16 18:50:55 +03:00
|
|
|
condition: and(failed(),
|
|
|
|
or(eq(variables['Build.SourceBranchName'], 'master'),
|
2020-04-20 18:01:08 +03:00
|
|
|
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
|