-
Notifications
You must be signed in to change notification settings - Fork 117
/
build-triggers.yaml
170 lines (139 loc) · 3.62 KB
/
build-triggers.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
---
apiVersion: tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
name: build-triggertemplate
namespace: sig-build
spec:
params:
- name: namespace
description: The namespace to create the resources
default: sig-build
- name: git-revision
description: The git revision
default: master
- name: git-repo-owner
description: The github repository owner
- name: git-repo-name
description: The github repository name
resourcetemplates:
- apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: source-repo-$(uid)
namespace: $(params.namespace)
spec:
type: git
params:
- name: revision
value: $(params.git-revision)
- name: url
value: "https://github.com/$(params.git-repo-owner)/$(params.git-repo-name).git"
- apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: image-webhook-$(uid)
namespace: $(params.namespace)
spec:
type: image
params:
- name: url
value: gcr.io/tensorflow-build-224104/$(params.git-repo-owner)-$(params.git-repo-name)/webhook:latest
- apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: image-linuxcpu-$(uid)
namespace: $(params.namespace)
spec:
type: image
params:
- name: url
value: gcr.io/tensorflow-build-224104/$(params.git-repo-owner)-$(params.git-repo-name)/linux/cpu:latest
- apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
name: build-pipeline-run-$(uid)
namespace: $(params.namespace)
spec:
serviceAccountName: kaniko-push
pipelineRef:
name: build-pipeline
#podTemplate:
#nodeSelector:
# cloud.google.com/gke-nodepool: pool-n1-s2
resources:
- name: source-repo
resourceRef:
name: source-repo-$(uid)
- name: image-webhook
resourceRef:
name: image-webhook-$(uid)
- name: image-linuxcpu
resourceRef:
name: image-linuxcpu-$(uid)
---
apiVersion: tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
name: build-pipelinebinding
namespace: sig-build
spec:
params:
- name: namespace
value: sig-build
- name: git-revision
value: $(body.head_commit.id)
- name: git-repo-owner
value: $(body.repository.owner.name)
- name: git-repo-name
value: $(body.repository.name)
---
apiVersion: tekton.dev/v1alpha1
kind: EventListener
metadata:
name: build-listener
namespace: sig-build
spec:
serviceAccountName: tekton-triggers-admin
serviceType: NodePort
triggers:
- name: github-trigger
binding:
name: build-pipelinebinding
template:
name: build-triggertemplate
interceptor:
objectRef:
kind: Service
name: webhook-validator
apiVersion: v1
namespace: sig-build
---
apiVersion: networking.gke.io/v1beta1
kind: ManagedCertificate
metadata:
name: tfbuild-cert
namespace: sig-build
spec:
domains:
- tfbuild.perfinion.com
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: build-listener
namespace: sig-build
labels:
app: build-listener
annotations:
kubernetes.io/ingress.global-static-ip-name: tfbuild
networking.gke.io/managed-certificates: tfbuild-cert
spec:
rules:
- http:
paths:
- path: /webhook/*
backend:
serviceName: el-build-listener
servicePort: 8080
---