cepler 0.7.15

(Capricious Environment Propagator)-ler
Documentation
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
#@ load("@ytt:data", "data")

#@ def concourse_resource_image():
#@   return data.values.docker_registry + "/cepler-concourse-resource"
#@ end

#@ def pipeline_image():
#@   return data.values.docker_registry + "/cepler-pipeline"
#@ end

#@ def task_image_config():
type: registry-image
source:
  username: #@ data.values.docker_registry_user
  password: #@ data.values.docker_registry_password
  repository: #@ pipeline_image()
#@ end

groups:
- name: release
  jobs:
  - minor
  - major
  - test-unit
  - test-integration
  - build-concourse-resource-edge
  - rc
  - release
  - auto-bump-patch
  - publish
- name: image
  jobs:
    - build-pipeline-image

jobs:
- name: build-pipeline-image
  serial: true
  plan:
  - {get: pipeline-image-def, trigger: true}
  - task: build
    privileged: true
    config:
      platform: linux
      image_resource:
        type: registry-image
        source:
          repository: vito/oci-build-task
      inputs:
      - name: pipeline-image-def
      outputs:
      - name: image
      params:
        CONTEXT: pipeline-image-def/ci/image
      run:
        path: build
  - put: pipeline-image
    params:
      image: image/image.tar

- name: minor
  public: true
  plan:
  - in_parallel:
    - { get: repo }
    - { get: pipeline-tasks }
    - { get: version, params: { bump: minor, pre: rc } }
  - in_parallel:
    - { put: version, params: { file: version/number } }
    - do:
      - task: set-dev-version
        config:
          image_resource: #@ task_image_config()
          platform: linux
          inputs:
          - name: version
          - name: repo
          - name: pipeline-tasks
          outputs:
          - name: repo
          run:
            path: pipeline-tasks/ci/tasks/set-dev-version.sh
          params:
            BRANCH: #@ data.values.git_branch
      - put: repo
        params:
          repository: repo
          rebase: true

- name: major
  public: true
  plan:
  - in_parallel:
    - { get: repo }
    - { get: pipeline-tasks }
    - { get: version, params: { bump: minor, pre: rc } }
  - in_parallel:
    - { put: version, params: { file: version/number } }
    - do:
      - task: set-dev-version
        config:
          image_resource: #@ task_image_config()
          platform: linux
          inputs:
          - name: version
          - name: repo
          - name: pipeline-tasks
          outputs:
          - name: repo
          run:
            path: pipeline-tasks/ci/tasks/set-dev-version.sh
          params:
            BRANCH: #@ data.values.git_branch
      - put: repo
        params:
          repository: repo
          rebase: true

- name: test-unit
  plan:
  - in_parallel:
    - { get: repo, trigger: true }
    - { get: pipeline-tasks }
  - in_parallel:
    - task: test-unit
      config:
        platform: linux
        image_resource: #@ task_image_config()
        inputs:
        - name: pipeline-tasks
        - name: repo
        caches:
        - path: cargo-home
        - path: cargo-target-dir
        run:
          path: pipeline-tasks/ci/tasks/test-unit.sh

- name: build-concourse-resource-edge
  plan:
  - { get: repo, trigger: true }
  - task: build-concourse-resource-image
    privileged: true
    config:
      platform: linux
      image_resource:
        type: registry-image
        source:
          repository: vito/oci-build-task
      inputs:
      - name: repo
      outputs:
      - name: image
      params:
        CONTEXT: repo
        DOCKERFILE: repo/images/concourse/Dockerfile
      run:
        path: build
  - put: concourse-resource-image-edge
    params:
      image: image/image.tar

- name: test-integration
  plan:
  - in_parallel:
    - { get: repo, trigger: true }
    - { get: pipeline-tasks }
  - in_parallel:
    - task: test-integration
      config:
        platform: linux
        image_resource: #@ task_image_config()
        inputs:
        - name: pipeline-tasks
        - name: repo
        caches:
        - path: cargo-home
        - path: cargo-target-dir
        run:
          path: pipeline-tasks/ci/tasks/test-integration.sh

- name: rc
  serial: true
  plan:
  - in_parallel:
    - get: repo
      trigger: true
      passed:
      - test-integration
      - test-unit
    - { get: version, params: { pre: rc } }
  - put: version
    params: { file: version/number }

- name: release
  plan:
  - in_parallel:
    - { get: version, passed: [rc], params: {bump: final} }
    - { get: repo, passed: [rc] }
    - { get: pipeline-tasks }
  - task: prepare
    config:
      image_resource: #@ task_image_config()
      platform: linux
      inputs:
      - name: version
      - name: repo
      - name: pipeline-tasks
      outputs:
      - name: prepared-repo
      params:
        BRANCH: #@ data.values.git_branch
      run:
        path: pipeline-tasks/ci/tasks/prepare-repo.sh
  - in_parallel:
    - do:
      - put: repo
        params:
          repository: prepared-repo/git
          merge: true
      - put: version
        params: { bump: final }
    - task: build-osx-release
      privileged: true
      config:
        platform: linux
        image_resource:
          type: registry-image
          source:
            username: #@ data.values.osxcross_docker_username
            password: #@ data.values.osxcross_docker_password
            repository: #@ data.values.osxcross_repository
        inputs:
        - name: version
        - name: pipeline-tasks
        - name: prepared-repo
        outputs:
        - name: x86_64-apple-darwin
        caches:
        - path: cargo-home
        - path: cargo-target-dir
        params:
          TARGET: x86_64-apple-darwin
          REPO: prepared-repo/git
          OUT: x86_64-apple-darwin
        run:
          path: pipeline-tasks/ci/tasks/build-release.sh
    - task: build-static-release
      privileged: true
      config:
        platform: linux
        image_resource:
          type: registry-image
          source: { repository: clux/muslrust, tag: stable }
        inputs:
        - name: version
        - name: pipeline-tasks
        - name: prepared-repo
        outputs:
        - name: x86_64-unknown-linux-musl
        caches:
        - path: cargo-home
        - path: cargo-target-dir
        params:
          TARGET: x86_64-unknown-linux-musl
          REPO: prepared-repo/git
          OUT: x86_64-unknown-linux-musl
        run:
          path: pipeline-tasks/ci/tasks/build-release.sh
  - in_parallel:
    - do:
      - task: github-release
        config:
          image_resource: #@ task_image_config()
          platform: linux
          inputs:
          - name: x86_64-apple-darwin
          - name: x86_64-unknown-linux-musl
          - name: version
          - name: prepared-repo
          - name: pipeline-tasks
          outputs:
          - name: gh-release
          params:
            BRANCH: #@ data.values.git_branch
          run:
            path: pipeline-tasks/ci/tasks/github-release.sh
      - put: github-release
        params:
          name:   gh-release/name
          tag:    gh-release/tag
          body:   gh-release/notes.md
          globs: [gh-release/artifacts/*]
    - do:
      - task: build-concourse-resource-image
        privileged: true
        config:
          platform: linux
          image_resource:
            type: registry-image
            source:
              repository: vito/oci-build-task
          inputs:
          - name: prepared-repo
          outputs:
          - name: image
          params:
            CONTEXT: prepared-repo/git
            DOCKERFILE: prepared-repo/git/images/concourse/Dockerfile
          run:
            path: build
      - put: concourse-resource-image
        params:
          image: image/image.tar
          additional_tags: version/number

- name: auto-bump-patch
  plan:
  - in_parallel:
    - { get: repo }
    - { get: pipeline-tasks }
    - { get: version, trigger: true, params: { bump: patch, pre: rc }, passed: [release] }
  - in_parallel:
    - { put: version, params: { file: version/number } }
    - do:
      - task: set-dev-version
        config:
          image_resource: #@ task_image_config()
          platform: linux
          inputs:
          - name: version
          - name: repo
          - name: pipeline-tasks
          outputs:
          - name: repo
          run:
            path: pipeline-tasks/ci/tasks/set-dev-version.sh
          params:
            BRANCH: #@ data.values.git_branch
      - put: repo
        params:
          repository: repo
          rebase: true

- name: publish
  public: true
  plan:
  - in_parallel:
    - { get: repo, passed: [release] }
    - { get: version, passed: [release], trigger: true }
    - { get: pipeline-tasks }
  - task: publish-to-crates
    config:
      image_resource: #@ task_image_config()
      platform: linux
      inputs:
      - name: version
      - name: pipeline-tasks
      - name: repo
      params:
        CRATES_API_TOKEN: #@ data.values.crates_api_token
      caches:
      - path: cargo-home
      - path: cargo-target-dir
      run:
        path: pipeline-tasks/ci/tasks/publish-to-crates.sh
  - task: verify-publish
    config:
      image_resource: #@ task_image_config()
      platform: linux
      inputs:
      - name: version
      - name: pipeline-tasks
      run:
        path: pipeline-tasks/ci/tasks/verify-publish.sh

resources:
- name: repo
  type: git
  source:
    ignore_paths: ["ci/*[^md]"]
    uri: #@ data.values.git_uri
    branch: #@ data.values.git_branch
    private_key: #@ data.values.github_private_key

- name: concourse-resource-image
  type: registry-image
  source:
    tag: latest
    username: #@ data.values.docker_registry_user
    password: #@ data.values.docker_registry_password
    repository: #@ concourse_resource_image()

- name: concourse-resource-image-edge
  type: registry-image
  source:
    tag: edge
    username: #@ data.values.docker_registry_user
    password: #@ data.values.docker_registry_password
    repository: #@ concourse_resource_image()

- name: pipeline-tasks
  type: git
  source:
    uri: #@ data.values.git_uri
    branch: #@ data.values.git_branch
    paths: [ci/tasks/*, Makefile]
    private_key: #@ data.values.github_private_key

- name: pipeline-image
  type: registry-image
  source:
    tag: latest
    username: #@ data.values.docker_registry_user
    password: #@ data.values.docker_registry_password
    repository: #@ pipeline_image()

- name: pipeline-image-def
  type: git
  source:
    uri: #@ data.values.git_uri
    branch: #@ data.values.git_branch
    paths: [ci/image/Dockerfile]
    private_key: #@ data.values.github_private_key

- name: version
  type: semver
  source:
    driver: git
    file: version
    uri: #@ data.values.git_uri
    branch: #@ data.values.git_version_branch
    private_key: #@ data.values.github_private_key

- name: github-release
  type: github-release
  source:
    user:         #@ data.values.github_owner
    repository:   #@ data.values.github_repo
    access_token: #@ data.values.github_access_token