-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.yaml
126 lines (126 loc) · 2.94 KB
/
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
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
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
labels:
kustomize.toolkit.fluxcd.io/name: tekton-pipelines
kustomize.toolkit.fluxcd.io/namespace: flux-system
name: clone-build-push
namespace: t-pauwels-labs-main
spec:
description: |
This pipeline clones a git repo, builds a Docker image with Kaniko and
pushes it to a registry
params:
- name: revision
type: string
- name: repositoryurl
type: string
- name: sshurl
type: string
- name: imageurl
type: string
- name: ghtokensecretname
type: string
tasks:
- name: fetch-source
params:
- name: url
value: $(params.sshurl)
- name: revision
value: $(params.revision)
- name: depth
value: "1"
- name: userHome
value: /home/git
taskRef:
kind: Task
params:
- name: kind
value: task
- name: name
value: git-clone
- name: namespace
value: i-tekton-pipelines
resolver: cluster
workspaces:
- name: output
workspace: shared-data
- name: ssh-directory
workspace: git-credentials
- name: version
runAfter:
- fetch-source
taskRef:
kind: Task
params:
- name: kind
value: task
- name: name
value: version
- name: namespace
value: i-tekton-pipelines
resolver: cluster
workspaces:
- name: source
workspace: shared-data
- name: git-ssh
workspace: git-credentials
- name: build-push
params:
- name: GH_TOKEN_SECRET_NAME
value: $(params.ghtokensecretname)
- name: IMAGE
value: $(params.imageurl):$(tasks.version.results.RELEASE_VERSION)
- name: EXTRA_ARGS
value:
- --cache=true
- --cache-dir=/kaniko/cache
- --cache-repo=$(params.imageurl)/cache
runAfter:
- version
taskRef:
kind: Task
params:
- name: kind
value: task
- name: name
value: kaniko
- name: namespace
value: i-tekton-pipelines
resolver: cluster
workspaces:
- name: source
workspace: shared-data
- name: dockerconfig
workspace: docker-credentials
- name: git-ssh
workspace: git-credentials
- name: release
params:
- name: GH_TOKEN_SECRET_NAME
value: $(params.ghtokensecretname)
runAfter:
- build-push
taskRef:
kind: Task
params:
- name: kind
value: task
- name: name
value: release
- name: namespace
value: i-tekton-pipelines
resolver: cluster
workspaces:
- name: source
workspace: shared-data
- name: git-ssh
workspace: git-credentials
workspaces:
- description: Contains the cloned git repo
name: shared-data
- description: Contains SSH credentials for authenticating to private Git repos
name: git-credentials
- description: Contains docker credentials for authenticating to private container
registry
name: docker-credentials