-
Notifications
You must be signed in to change notification settings - Fork 14
/
cogito.yml
171 lines (158 loc) · 4.64 KB
/
cogito.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Names are an homage to https://hanna-barbera.fandom.com/wiki/Cattanooga_Cats
# NOTICE
# In this pipeline we have two cogito resources ONLY BECAUSE this is a test pipeline!
# In a real pipeline, one cogito resource is always enough. If not, please open an
# issue to discuss your use case.
meta:
gh-status-1-handlers: &gh-status-1-handlers
on_success:
put: gh-status-1
inputs: [repo.git]
params: {state: success}
on_failure:
put: gh-status-1
inputs: [repo.git]
params: {state: failure}
on_error:
put: gh-status-1
inputs: [repo.git]
params: {state: error}
on_abort:
put: gh-status-1
inputs: [repo.git]
params: {state: abort}
gh-status-2-handlers: &gh-status-2-handlers
on_success:
put: gh-status-2
inputs: [repo.git]
params: {state: success}
on_failure:
put: gh-status-2
inputs: [repo.git]
params: {state: failure}
on_error:
put: gh-status-2
inputs: [repo.git]
params: {state: error}
on_abort:
put: gh-status-2
inputs: [repo.git]
params: {state: abort}
resource_types:
- name: cogito
type: registry-image
# For production use, `24h` is a good tradeoff to get a new release with a maximum delay
# of 24h. Here we parametrize it to work around a concourse bug when doing development.
# See CONTRIBUTING for details
check_every: ((cogito-image-check_every))
source:
repository: pix4d/cogito
tag: ((cogito-tag))
resources:
- name: gh-status-1
type: cogito
# Since check is a no-op, we do not check, to reduce load on the system.
check_every: never
source:
# Optional, for debugging only.
log_level: debug
owner: ((github-owner))
repo: ((repo-name))
access_token: ((oauth-personal-access-token))
gchat_webhook: ((gchat_webhook))
# See the NOTICE at the top of this file to understand why we have two cogito resources.
- name: gh-status-2
type: cogito
# Since check is a no-op, we do not check, to reduce load on the system.
check_every: never
source:
# Optional, for debugging only.
log_level: debug
owner: ((github-owner))
repo: ((repo-name))
access_token: ((oauth-personal-access-token))
gchat_webhook: ((gchat_webhook))
# These two states make sense only for testing the resource itself...
chat_notify_on_states: [pending, success]
- name: repo.git
type: git
source:
# If repo is public:
uri: https://github.com/((github-owner))/((repo-name)).git
# If repo is private:
#uri: [email protected]:((github-owner))/((repo-name)).git
#private_key: ((ssh-key))
branch: ((branch))
jobs:
- name: autocat
<<: *gh-status-1-handlers
plan:
- get: repo.git
trigger: true
- put: gh-status-1
inputs: [repo.git]
params: {state: pending}
- task: will-fail
config:
platform: linux
image_resource:
type: registry-image
source: { repository: alpine }
run:
path: /bin/false
- name: motormouse
<<: *gh-status-1-handlers
plan:
- get: repo.git
trigger: true
- put: gh-status-1
inputs: [repo.git]
params: {state: pending}
- task: will-succeed
config:
platform: linux
image_resource:
type: registry-image
source: { repository: alpine }
run:
path: /bin/true
- name: kitty-jo
<<: *gh-status-2-handlers
plan:
- get: repo.git
trigger: true
- put: gh-status-2
inputs: [repo.git]
params:
state: pending
gchat_webhook: ((gchat_webhook_2))
- task: task-1
config:
platform: linux
image_resource:
type: registry-image
source: { repository: alpine }
run:
path: /bin/true
- put: gh-status-2
inputs: [repo.git]
params:
# FIXME Here the state doesn't really make sense, because we are in the middle
# of a job and there are further tasks: the state could change...
state: success
# Override the default build summary with the custom message.
chat_message: "overriding hello from kitty-jo"
- task: task-2
config:
platform: linux
image_resource:
type: registry-image
source: { repository: alpine }
run:
path: /bin/true
- put: gh-status-2
inputs: [repo.git]
params:
state: success
# Append the default build summary to the custom message.
chat_message: "appending hello from kitty-jo"