/
pipeline.yml
270 lines (256 loc) · 7.03 KB
/
pipeline.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
resource_types:
- name: concourse-pipeline
type: docker-image
source:
repository: concourse/concourse-pipeline-resource
aws-config: &aws-config
access_key_id: ((aws-key-id))
secret_access_key: ((aws-key-secret))
test-bucket: &test-bucket
<< : *aws-config
bucket: ((default-cicd-bucket))
region_name: eu-west-1
resources:
# pipeline ci
- name: concourse-pipeline
type: concourse-pipeline
source:
teams:
- name: main
username: ((concourse-main-username))
password: ((concourse-main-password))
- name: github-machete-pipeline
type: git
source:
uri: https://github.com/Bit-Clouded/aws-machete.git
paths: ['pipeline.yml', 'pipeline-pr.yml']
# bin input
- name: github-machete-s3
type: git
source:
uri: https://github.com/Bit-Clouded/aws-machete.git
paths: ['src/s3/*', 'src/s3/**/*', 'src/build-task.yml']
- name: github-machete-cloudformation
type: git
source:
uri: https://github.com/Bit-Clouded/aws-machete.git
paths: ['src/cloudformation/*', 'src/cloudformation/**/*', 'src/build-task.yml']
- name: golang-build
type: registry-image
source:
repository: golang
tag: alpine
# bin output
- name: s3-artifact
type: s3
source:
<< : *test-bucket
regexp: aws-machete/bin/s3-(.*)
initial_path: aws-machete/bin/s3-aaa
- name: cloudformation-artifact
type: s3
source:
<< : *test-bucket
regexp: aws-machete/bin/cloudformation-(.*)
initial_path: aws-machete/bin/cloudformation-aaa
# docker input
- name: golang-cli
# we are separating the cli base image from the build base image.
# this allows us to pinpoint if an issue caused by the image affects the build or the run time.
type: registry-image
source:
repository: golang
tag: alpine
- name: builder-task
type: registry-image
source:
repository: concourse/builder-task
- name: github-machete-dockerfile
type: git
source:
uri: https://github.com/Bit-Clouded/aws-machete.git
paths: ['docker/*', 'docker/**/*']
- name: test-image
type: registry-image
source:
repository: bitcloudedci/aws-machete
username: ((dh-username))
password: ((dh-password))
- name: rc-image
type: registry-image
source:
repository: bitcloudedci/aws-machete
username: ((dh-username))
password: ((dh-password))
- name: prod-image
type: registry-image
source:
repository: bitclouded/aws-machete
username: ((dh-username))
password: ((dh-password))
- name: container-prod-semver
type: semver
source:
<< : *test-bucket
key: aws-machete/semver-prod-0.0
initial_version: 0.0.0
- name: container-test-semver
type: semver
source:
<< : *test-bucket
key: aws-machete/semver-test-0.0
initial_version: 0.0.0
- name: container-rc-semver
type: semver
source:
<< : *test-bucket
key: aws-machete/semver-rc-0.0
initial_version: 0.0.0
jobs:
- name: set-pipelines
public: true
plan:
- get: github-machete-pipeline
trigger: true
- put: concourse-pipeline
params:
pipelines:
- name: aws-machete
unpaused: true
team: main
config_file: github-machete-pipeline/pipeline.yml
- put: concourse-pipeline
params:
pipelines:
- name: aws-machete-pr
unpaused: true
team: main
config_file: github-machete-pipeline/pipeline-pr.yml
- name: build-s3
public: true
plan:
- get: concourse-pipeline
passed: ['set-pipelines']
trigger: false
- get: golang-build
trigger: false
- get: github-machete-s3
trigger: true
- task: build
image: golang-build
file: github-machete-s3/src/build-task.yml
vars:
input: github-machete-s3
bin-name: s3
build-path: src/s3
- put: s3-artifact
params:
file: bin/s3-*
acl: public-read
- name: build-cloudformation
public: true
plan:
- get: concourse-pipeline
passed: ['set-pipelines']
trigger: false
- get: golang-build
trigger: false
- get: github-machete-cloudformation
trigger: true
- task: build
image: golang-build
file: github-machete-cloudformation/src/build-task.yml
vars:
input: github-machete-cloudformation
bin-name: cloudformation
build-path: src/cloudformation
- put: cloudformation-artifact
params:
file: bin/cloudformation-*
acl: public-read
- name: docker-build
public: true
plan:
- get: container-test-semver
trigger: false
params: {pre: test}
- get: cloudformation-artifact
passed: ['build-cloudformation']
trigger: true
- get: s3-artifact
passed: ['build-s3']
trigger: true
- get: github-machete-dockerfile
trigger: true
- get: golang-cli
trigger: false
params:
format: oci
- get: builder-task
trigger: false
- task: assemble
image: builder-task
file: github-machete-dockerfile/docker/build-task.yml
privileged: true
vars:
repository: bitcloudedci/aws-machete
docker-semver: container-test-semver
dockerfile: github-machete-dockerfile
- put: test-image
params:
image: image/image.tar
additional_tags: container-test-semver/number
- put: container-test-semver
params:
file: container-test-semver/number
- name: promote-to-rc
public: true
plan:
- get: test-image
passed: ['docker-build']
trigger: false
params:
format: oci
- get: container-rc-semver
trigger: false
params: {pre: rc}
- put: rc-image
params:
image: test-image/image.tar
additional_tags: container-rc-semver/number
- put: container-rc-semver
params:
file: container-rc-semver/number
- name: promote-to-release
public: true
plan:
- get: rc-image
passed: ['promote-to-rc']
trigger: false
params:
format: oci
- get: container-rc-semver
trigger: false
params: {bump: final}
- put: prod-image
params:
image: rc-image/image.tar
additional_tags: container-rc-semver/number
- put: container-prod-semver
params:
file: container-rc-semver/number
- put: container-prod-semver
params:
bump: patch
- name: reset-release-semvers
public: true
plan:
- get: container-prod-semver
passed: ['promote-to-release']
trigger: true
- put: container-test-semver
params:
file: container-prod-semver/number
- put: container-rc-semver
params:
file: container-prod-semver/number