Skip to content

Release Controller #366

Release Controller

Release Controller #366

# control workflow which orchestrates manual release builds in
# all dataflow repos, aka one click train build.
name: Release 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: 20
dispatch-handler-config: >
[
{
"if": "initial == true",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-deployer",
"ref": "main",
"workflow": "release-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": "main",
"workflow": "release-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": "main",
"workflow": "release-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": "main",
"workflow": "promote-release.yml"
}
},
{
"if": "data.event == 'promote-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "central-release.yml"
}
},
{
"if": "data.event == 'central-succeed' && data.repo == 'spring-cloud-dataflow' && data.owner == 'spring-cloud'",
"action": "workflow_dispatch",
"workflow_dispatch": {
"owner": "spring-cloud",
"repo": "spring-cloud-dataflow",
"ref": "main",
"workflow": "github-release.yml"
}
},
{
"if": "data.event == 'promotion-failed'",
"action": "fail",
"fail": {
"message": "artifactory promotion failed"
}
},
{
"if": "data.event == 'central-failed'",
"action": "fail",
"fail": {
"message": "central sync failed"
}
},
{
"if": "data.event == 'ghrelease-failed'",
"action": "fail",
"fail": {
"message": "github release failed"
}
},
{
"if": "data.event == 'build-failed'",
"action": "fail",
"fail": {
"message": "something went wrong in build train"
}
}
]