Skip to content

Build Snapshot Controller #14150

Build Snapshot Controller

Build Snapshot Controller #14150

# 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-deployer",
"ref": "2.9.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-dataflow-ui",
"ref": "3.4.x",
"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.11.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.11.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"
}
}
]