daml/ci/daily_tell_slack.yml
Gary Verhaegen a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00

32 lines
1.1 KiB
YAML

# Copyright (c) 2021 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:
- template: bash-lib.yml
parameters:
var_name: bash_lib
- bash: |
set -euo pipefail
eval "$(dev-env/bin/dade assist)"
source $(bash_lib)
COMMIT_TITLE="$(escape_slack "$(git log --pretty=format:%s -n1 ${{ parameters.trigger_sha }})")"
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}"
if [ "$(Build.SourceBranchName)" = "main" ]; then
curl -XPOST \
-i \
-H 'Content-type: application/json' \
--data "$PAYLOAD" \
$(Slack.team-daml)
fi
displayName: report
condition: always()