-
Notifications
You must be signed in to change notification settings - Fork 583
114 lines (111 loc) · 3.92 KB
/
release-controller.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# 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"
}
}
]