# 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="" if [ "$(Agent.JobStatus)" != "Succeeded" ]; then MESSAGE=":fire: :fire: :fire: :fire:\n$(Agent.JobName) *FAILED*: $COMMIT_LINK\n:fire: :fire:" else MESSAGE=${{ parameters['success-message'] }} fi PAYLOAD="{\"text\":\"$MESSAGE\n\"}" if [ "$(Build.SourceBranchName)" = "master" ]; then curl -XPOST \ -i \ -H 'Content-type: application/json' \ --data "$PAYLOAD" \ $(Slack.team-daml) else echo "$PAYLOAD" fi displayName: report condition: always()