forked from redhat-ai-dev/ai-lab-helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-build-ai-software-templates-chart.yaml
176 lines (176 loc) · 5.41 KB
/
docker-build-ai-software-templates-chart.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
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
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
labels:
pipelines.openshift.io/runtime: generic
pipelines.openshift.io/strategy: docker
pipelines.openshift.io/used-by: build-cloud
name: docker-build-ai-software-templates-chart
spec:
finally:
- name: show-sbom
params:
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
taskRef:
name: show-sbom-rhdh
- name: show-summary
params:
- name: pipelinerun-name
value: $(context.pipelineRun.name)
- name: git-url
value: $(tasks.clone-repository.results.url)?rev=$(tasks.clone-repository.results.commit)
- name: image-url
value: $(params.output-image)
- name: build-task-status
value: $(tasks.build-container.status)
taskRef:
name: summary
workspaces:
- name: workspace
workspace: workspace
params:
- description: Source Repository URL
name: git-url
type: string
- default: ""
description: Revision of the Source Repository
name: revision
type: string
- description: Fully Qualified Output Image
name: output-image
type: string
- default: .
description: Path to the source code of an application's component from where to build image.
name: path-context
type: string
- default: Dockerfile
description: Path to the Dockerfile inside the context specified by parameter path-context
name: dockerfile
type: string
- default: "false"
description: Force rebuild image
name: rebuild
type: string
- default: ""
description: Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.
name: image-expires-after
# Not required for helm chart
# - default: gitops-auth-secret
# description: 'Secret name to enable this pipeline to update the gitops repo with the new image. '
# name: gitops-auth-secret-name
# type: string
- default: push
description: Event that triggered the pipeline run, e.g. push, pull_request
name: event-type
type: string
- default: []
description: Array of --build-arg values ("arg=value" strings) for buildah
name: build-args
type: array
- default: ""
description: Path to a file with build arguments for buildah, see https://www.mankier.com/1/buildah-build#--build-arg-file
name: build-args-file
type: string
- description: The name of the OpenShift Deployment we want to update
name: deployment-name
type: string
- description: The Namespace of the Deployment we want to update
name: deployment-namespace
type: string
- default: "app-inference"
description: The Container of the Deployment that it's image will be updated
name: container-name
type: string
results:
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
- name: IMAGE_DIGEST
value: $(tasks.build-container.results.IMAGE_DIGEST)
- name: CHAINS-GIT_URL
value: $(tasks.clone-repository.results.url)
- name: CHAINS-GIT_COMMIT
value: $(tasks.clone-repository.results.commit)
tasks:
- name: init
params:
- name: image-url
value: $(params.output-image)
- name: rebuild
value: $(params.rebuild)
taskRef:
name: init
- name: clone-repository
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.revision)
runAfter:
- init
taskRef:
name: git-clone
when:
- input: $(tasks.init.results.build)
operator: in
values:
- "true"
workspaces:
- name: output
workspace: workspace
- name: basic-auth
workspace: git-auth
- name: build-container
params:
- name: IMAGE
value: $(params.output-image)
- name: DOCKERFILE
value: $(params.dockerfile)
- name: CONTEXT
value: $(params.path-context)
- name: IMAGE_EXPIRES_AFTER
value: $(params.image-expires-after)
- name: COMMIT_SHA
value: $(tasks.clone-repository.results.commit)
- name: BUILD_ARGS
value:
- $(params.build-args[*])
- name: BUILD_ARGS_FILE
value: $(params.build-args-file)
runAfter:
- clone-repository
taskRef:
name: buildah-ai-rhdh
when:
- input: $(tasks.init.results.build)
operator: in
values:
- "true"
workspaces:
- name: source
workspace: workspace
- name: update-deployment
params:
- name: deployment-name
value: $(params.deployment-name)
- name: deployment-namespace
value: $(params.deployment-namespace)
- name: container-name
value: $(params.container-name)
- name: image
value: $(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)
runAfter:
- build-container
taskRef:
kind: Task
name: update-deployment
when:
- input: $(params.event-type)
operator: notin
values:
- pull_request
- Merge Request
workspaces:
- name: workspace
- name: git-auth
optional: true