From 77e7f8575d0eb2585e6041ea8b5a8e91f24f646d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:59:58 +0200 Subject: [PATCH] Pull together --- .azure-pipelines/main.yml | 5 +---- .azure-pipelines/templates/notifications-jobs.yml | 8 -------- .azure-pipelines/templates/notify-failure-steps.yml | 10 ++++++++++ 3 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 .azure-pipelines/templates/notifications-jobs.yml create mode 100644 .azure-pipelines/templates/notify-failure-steps.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 1c3ee7004..24d05c954 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -8,7 +8,4 @@ stages: - stage: Test jobs: - template: templates/standard-tests-jobs.yml - - stage: Notify - jobs: - - template: templates/notifications-jobs.yml - condition: succeededOrFailed() + - template: templates/notify-failure-steps.yml diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml deleted file mode 100644 index 7d81c7df3..000000000 --- a/.azure-pipelines/templates/notifications-jobs.yml +++ /dev/null @@ -1,8 +0,0 @@ -jobs: - - job: notify_failure - pool: - vmImage: ubuntu-latest - steps: - - bash: | - env - curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml new file mode 100644 index 000000000..4e6c06330 --- /dev/null +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -0,0 +1,10 @@ +stages: + - stage: Notify_Failure + jobs: + - job: notify + pool: + vmImage: ubuntu-latest + steps: + - bash: | + curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/$(Build.RepositoryId)/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" + condition: failed()