Build Snapshot Controller #11908
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
# control workflow which orchestrates manual snapshot builds in | |
# all dataflow repos, aka one click train build. | |
name: Build Snapshot Controller | |
on: | |
workflow_dispatch: | |
inputs: | |
build-zoo-handler: | |
description: 'Build Zoo Handler Payload' | |
required: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# initial is when user starts workflow from UI(context is empty) | |
# then train build goes through via repos using defined hander rules | |
- name: Handle Zoo Control | |
uses: jvalkeal/[email protected] | |
with: | |
dispatch-handler-token: ${{ secrets.SCDF_ACCESS_TOKEN }} | |
dispatch-handler-max: 15 | |
dispatch-handler-config: > | |
[ | |
{ | |
"if": "initial == true", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-dataflow-build", | |
"ref": "2.10.x", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow-build' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-dataflow-common", | |
"ref": "2.10.x", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow-common' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-deployer", | |
"ref": "2.8.x", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-deployer' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-deployer-local", | |
"ref": "main", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-deployer-local' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-deployer-cloudfoundry", | |
"ref": "main", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-deployer-cloudfoundry' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-deployer-kubernetes", | |
"ref": "main", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-deployer-kubernetes' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-common-security-config", | |
"ref": "main", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-common-security-config' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-skipper", | |
"ref": "main", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-skipper' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-dataflow-ui", | |
"ref": "main", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow-ui' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-dataflow", | |
"ref": "2.10.x", | |
"workflow": "build-snapshot-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'", | |
"action": "workflow_dispatch", | |
"workflow_dispatch": { | |
"owner": "spring-cloud", | |
"repo": "spring-cloud-dataflow", | |
"ref": "2.10.x", | |
"workflow": "carvel-worker.yml" | |
} | |
}, | |
{ | |
"if": "data.event == 'build-failed'", | |
"action": "fail", | |
"fail": { | |
"message": "hi, something went wrong" | |
} | |
}, | |
{ | |
"if": "data.event == 'carvel-failed'", | |
"action": "fail", | |
"fail": { | |
"message": "hi, something went wrong with carvel" | |
} | |
} | |
] |