Skip to content

Commit 541ad6e

Browse files
author
fmeng
committed
change taskrun to pipelinerune
1 parent 989f2c0 commit 541ad6e

File tree

1 file changed

+65
-48
lines changed

1 file changed

+65
-48
lines changed

tekton/local-gitlab/gitlab-pipeline.yaml

+65-48
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ kind: ServiceAccount
33
metadata:
44
name: cncamp-gitlab-sa
55
---
6+
apiVersion: v1
7+
kind: Secret
8+
metadata:
9+
name: cncamp-gitlab-secret
10+
type: Opaque
11+
stringData:
12+
secretToken: '1234567'
13+
---
14+
apiVersion: v1
15+
kind: Secret
16+
metadata:
17+
name: cncamp-gitlab-auth
18+
annotations:
19+
tekton.dev/git-1: http://gitlab.default.svc.cluster.local
20+
type: kubernetes.io/basic-auth
21+
stringData:
22+
username: root
23+
password: lzKyburULL0j4qnumSNI2fZycQCMkw8Is5t6D5iy790=
24+
---
625
apiVersion: triggers.tekton.dev/v1alpha1
726
kind: EventListener
827
metadata:
@@ -27,72 +46,70 @@ spec:
2746
template:
2847
ref: gitlab-triggertemplate
2948
---
30-
apiVersion: v1
31-
kind: Secret
32-
metadata:
33-
name: cncamp-gitlab-secret
34-
type: Opaque
35-
stringData:
36-
secretToken: '1234567'
37-
---
38-
apiVersion: v1
39-
kind: Secret
40-
metadata:
41-
name: cncamp-gitlab-auth
42-
annotations:
43-
tekton.dev/git-1: http://gitlab.default.svc.cluster.local
44-
type: kubernetes.io/basic-auth
45-
stringData:
46-
username: root
47-
password: lzKyburULL0j4qnumSNI2fZycQCMkw8Is5t6D5iy790=
48-
---
4949
apiVersion: triggers.tekton.dev/v1alpha1
5050
kind: TriggerBinding
5151
metadata:
52-
name: gitlab-binding
52+
name: gitlab-binding
5353
spec:
5454
params:
5555
- name: gitrevision
5656
value: $(body.checkout_sha)
5757
- name: gitrepositoryurl
58-
value: http://gitlab.default.svc.cluster.local/root/test.git
58+
value: http://gitlab/root/test.git
5959
---
6060
apiVersion: triggers.tekton.dev/v1alpha1
6161
kind: TriggerTemplate
6262
metadata:
6363
name: gitlab-triggertemplate
64-
spec:
64+
spec:
6565
params:
66-
- name: gitrevision
67-
- name: gitrepositoryurl
66+
- name: gitrevision
67+
- name: gitrepositoryurl
6868
resourcetemplates:
69-
- apiVersion: tekton.dev/v1beta1
70-
kind: TaskRun
71-
metadata:
72-
generateName: gitlab-run-
69+
- kind: PipelineRun
70+
apiVersion: tekton.dev/v1beta1
71+
metadata:
72+
generateName: gitlab-pipeline-run-
7373
spec:
7474
serviceAccountName: cncamp-gitlab-sa
75-
taskSpec:
76-
resources:
77-
inputs:
78-
- name: source
79-
type: git
80-
steps:
81-
- name: show-path
82-
image: ubuntu
83-
script: |
84-
#! /bin/bash
85-
ls -la $(resources.inputs.source.path)
75+
pipelineSpec:
76+
tasks:
77+
- name: checkout
78+
taskRef:
79+
name: gitlab-checkout
80+
resources:
81+
inputs:
82+
- name: source
83+
resource: source
84+
resources:
85+
- name: source
86+
type: git
8687
resources:
87-
inputs:
88-
- name: source
89-
resourceSpec:
90-
type: git
91-
params:
92-
- name: revision
93-
value: $(tt.params.gitrevision)
94-
- name: url
95-
value: $(tt.params.gitrepositoryurl)
88+
- name: source
89+
resourceSpec:
90+
type: git
91+
params:
92+
- name: revision
93+
value: $(tt.params.gitrevision)
94+
- name: url
95+
value: $(tt.params.gitrepositoryurl)
96+
---
97+
apiVersion: tekton.dev/v1beta1
98+
kind: Task
99+
metadata:
100+
name: gitlab-checkout
101+
spec:
102+
resources:
103+
inputs:
104+
- name: source
105+
type: git
106+
steps:
107+
- name: show-path
108+
image: ubuntu
109+
script: |
110+
#! /bin/bash
111+
cat /etc/resolv.conf
112+
ls -la $(resources.inputs.source.path)
96113
---
97114
apiVersion: v1
98115
kind: ServiceAccount

0 commit comments

Comments
 (0)