2021-01-01 21:49:51 +03:00
|
|
|
# Copyright (c) 2021 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:
|
2020-12-16 14:18:41 +03:00
|
|
|
- template: bash-lib.yml
|
|
|
|
parameters:
|
|
|
|
var_name: bash_lib
|
2019-07-04 17:22:22 +03:00
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
2020-12-16 14:18:41 +03:00
|
|
|
source $(bash_lib)
|
2020-12-17 16:32:49 +03:00
|
|
|
COMMIT_TITLE="$(escape_slack "$(git log --pretty=format:%s -n1 ${{ parameters.trigger_sha }})")"
|
2020-12-16 14:18:41 +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(),
|
2020-12-27 16:19:07 +03:00
|
|
|
or(eq(variables['Build.SourceBranchName'], 'main'),
|
2020-04-20 18:01:08 +03:00
|
|
|
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
|