mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 00:35:03 +02:00
Grab status from job in previous stage that depends on all other jobs
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
stages:
|
||||
- stage: Notify
|
||||
condition: succeededOrFailed()
|
||||
dependsOn: Deploy
|
||||
jobs:
|
||||
- job: notify_release_build
|
||||
variables:
|
||||
STAGE_STATUS: $[stageDependencies.Deploy.succeed_for_status.result]
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
@@ -13,5 +16,5 @@ stages:
|
||||
- bash: |
|
||||
set -e
|
||||
AUTHOR_NAME="$(git log -1 --pretty=format:'%an')"
|
||||
"${BUILD_REPOSITORY_LOCALPATH}/tools/notify_mattermost.py" "${AUTHOR_NAME}" $(webhook_url.secureFilePath) "${AGENT_JOBSTATUS}"
|
||||
"${BUILD_REPOSITORY_LOCALPATH}/tools/notify_mattermost.py" "${AUTHOR_NAME}" $(webhook_url.secureFilePath) "$(STAGE_STATUS)"
|
||||
displayName: Send mattermost message
|
||||
|
||||
@@ -25,3 +25,12 @@ stages:
|
||||
releaseNotesFilePath: '$(Pipeline.Workspace)/release_notes.md'
|
||||
assets: '$(Build.SourcesDirectory)/packages/{*.tar.gz,SHA256SUMS*}'
|
||||
addChangeLog: false
|
||||
- job: succeed_for_status
|
||||
dependsOn:
|
||||
- create_github_release
|
||||
- publish_snap
|
||||
- publish_docker_by_arch
|
||||
- publish_docker_multiarch
|
||||
steps:
|
||||
- bash: echo "success"
|
||||
displayName: 'Succeed to grab status for notification'
|
||||
@@ -49,12 +49,12 @@ fun_success_messages = [
|
||||
'all certbot release systems are set for launch!',
|
||||
]
|
||||
|
||||
if status in ['Succeeded', 'SucceededWithIssues ']:
|
||||
if status in ['Succeeded', 'SucceededWithIssues']:
|
||||
message = random.choice(fun_success_messages)
|
||||
elif status == 'Failed':
|
||||
elif status in ['Failed', 'Skipped']:
|
||||
message = "the release pipeline has failed."
|
||||
else:
|
||||
raise RuntimeError("Unexpected Azure job status encountered")
|
||||
raise RuntimeError("Unexpected Azure job status {0} encountered".format(status))
|
||||
|
||||
|
||||
azure_url = 'https://dev.azure.com/certbot/certbot/_build?definitionId=3'
|
||||
|
||||
Reference in New Issue
Block a user