forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
daily run: warn on master only (digital-asset#6177)
Currently the message to Slack is always triggered by running the daily checks. This means that it gets very noisy to: 1. Run the check on PRs affecting the check (like this one), 2. Rerun the check multiple times to ascertain that a given failure is flaky. With this PR, the message to Slack is replaced with a simple `echo` when these checks are not run from the `master` branch, so whoever (manually) triggered them can still get feedback on the result, but other people don't get spurious `@here` mentions. CHANGELOG_BEGIN CHANGELOG_END
- Loading branch information
1 parent
2dd034d
commit 445f646
Showing
2 changed files
with
39 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 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="<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\n\"}" | ||
if [ "$(variables['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() |