-
Notifications
You must be signed in to change notification settings - Fork 582
80 lines (77 loc) · 2.71 KB
/
build-snapshot-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
# 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": "main",
"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": "main-3",
"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": "main",
"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": "main",
"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"
}
}
]