mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 00:22:28 +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:
|
stages:
|
||||||
- stage: Notify
|
- stage: Notify
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
|
dependsOn: Deploy
|
||||||
jobs:
|
jobs:
|
||||||
- job: notify_release_build
|
- job: notify_release_build
|
||||||
|
variables:
|
||||||
|
STAGE_STATUS: $[stageDependencies.Deploy.succeed_for_status.result]
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -13,5 +16,5 @@ stages:
|
|||||||
- bash: |
|
- bash: |
|
||||||
set -e
|
set -e
|
||||||
AUTHOR_NAME="$(git log -1 --pretty=format:'%an')"
|
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
|
displayName: Send mattermost message
|
||||||
|
|||||||
@@ -25,3 +25,12 @@ stages:
|
|||||||
releaseNotesFilePath: '$(Pipeline.Workspace)/release_notes.md'
|
releaseNotesFilePath: '$(Pipeline.Workspace)/release_notes.md'
|
||||||
assets: '$(Build.SourcesDirectory)/packages/{*.tar.gz,SHA256SUMS*}'
|
assets: '$(Build.SourcesDirectory)/packages/{*.tar.gz,SHA256SUMS*}'
|
||||||
addChangeLog: false
|
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!',
|
'all certbot release systems are set for launch!',
|
||||||
]
|
]
|
||||||
|
|
||||||
if status in ['Succeeded', 'SucceededWithIssues ']:
|
if status in ['Succeeded', 'SucceededWithIssues']:
|
||||||
message = random.choice(fun_success_messages)
|
message = random.choice(fun_success_messages)
|
||||||
elif status == 'Failed':
|
elif status in ['Failed', 'Skipped']:
|
||||||
message = "the release pipeline has failed."
|
message = "the release pipeline has failed."
|
||||||
else:
|
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'
|
azure_url = 'https://dev.azure.com/certbot/certbot/_build?definitionId=3'
|
||||||
|
|||||||
Reference in New Issue
Block a user