-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtekton-pipeline.yaml
73 lines (73 loc) · 2.13 KB
/
tekton-pipeline.yaml
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
---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: pipeline-swift
spec:
description: |
Pipeline to build a Swift application with static library on bare minimal image.
params:
- name: app-name
type: string
description: "Name of the application to build"
- name: repo-url
type: string
description: "The git repo URL to clone from."
- name: git-revision
type: string
description: "Revision to checkout. (branch, tag, sha, ref, etc...)"
default: ""
- name: git-refspec
type: string
description: "Refspec to fetch before checking out revision."
default: ""
- name: compilerImage
type: string
description: "Image with Swift SDK to compile application."
- name: registry-url
type: string
description: "URL of the container registry to push the built image to."
- name: registry-org
type: string
description: "The organization of the container registry to push the built image to."
- name: image-tag
type: string
description: "Tag of the image to build"
workspaces:
- name: source
description: Workspace containing the clone source code and compiled binary before adding it to an image.
tasks:
- name: git-clone
params:
- name: url
value: $(params.repo-url)
- name: revision
value: $(params.git-revision)
- name: refspec
value: $(params.git-refspec)
taskRef:
name: git-clone
workspaces:
- name: source
- name: compile-swift-project
params:
- name: compilerImage
value: $(params.compilerImage)
taskRef:
name: swift-compiler
workspaces:
- name: source
runAfter:
- git-clone
- name: build-and-push
params:
- name: IMAGE
value: "$(params.registry-url)/$(params.registry-org)/$(params.app-name):$(params.image-tag)"
- name: BUILD_EXTRA_ARGS
value: "--build-arg binary=$(params.app-name)"
taskRef:
name: buildah
workspaces:
- name: source
runAfter:
- compile-swift-project