Skip to content

Commit cc403ff

Browse files
authored
Merge pull request #734 from sm43/pac-pr-templates
2 parents 0260b8a + 6a9157b commit cc403ff

File tree

4 files changed

+357
-0
lines changed

4 files changed

+357
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
apiVersion: tekton.dev/v1beta1
3+
kind: PipelineRun
4+
metadata:
5+
name: go-template
6+
annotations:
7+
# The event we are targeting as seen from the webhook payload
8+
# this can be an array too, i.e: [pull_request, push]
9+
pipelinesascode.tekton.dev/on-event: "pull_request"
10+
11+
# The branch or tag we are targeting (ie: main, refs/tags/*)
12+
pipelinesascode.tekton.dev/on-target-branch: "main"
13+
14+
# Fetch the git-clone task from hub, we are able to reference later on it
15+
# with taskRef and it will automatically be embedded into our pipeline.
16+
pipelinesascode.tekton.dev/task: "git-clone"
17+
18+
19+
# Task for Golang
20+
pipelinesascode.tekton.dev/task-1: "[golangci-lint]"
21+
22+
# You can add more tasks in here to reuse, browse the one you like from here
23+
# https://hub.tekton.dev/
24+
# example:
25+
# pipelinesascode.tekton.dev/task-2: "[maven, buildah]"
26+
27+
# How many runs we want to keep attached to this event
28+
pipelinesascode.tekton.dev/max-keep-runs: "5"
29+
spec:
30+
params:
31+
# The variable with brackets are special to Pipelines as Code
32+
# They will automatically be expanded with the events from Github.
33+
- name: repo_url
34+
value: "{{ repo_url }}"
35+
- name: revision
36+
value: "{{ revision }}"
37+
pipelineSpec:
38+
params:
39+
- name: repo_url
40+
- name: revision
41+
workspaces:
42+
- name: source
43+
- name: basic-auth
44+
tasks:
45+
- name: fetch-repository
46+
taskRef:
47+
name: git-clone
48+
workspaces:
49+
- name: output
50+
workspace: source
51+
- name: basic-auth
52+
workspace: basic-auth
53+
params:
54+
- name: url
55+
value: $(params.repo_url)
56+
- name: revision
57+
value: $(params.revision)
58+
- name: golangci-lint
59+
taskRef:
60+
name: golangci-lint
61+
runAfter:
62+
- fetch-repository
63+
params:
64+
- name: package
65+
value: .
66+
workspaces:
67+
- name: source
68+
workspace: source
69+
70+
workspaces:
71+
- name: source
72+
volumeClaimTemplate:
73+
spec:
74+
accessModes:
75+
- ReadWriteOnce
76+
resources:
77+
requests:
78+
storage: 1Gi
79+
# This workspace will inject secret to help the git-clone task to be able to
80+
# checkout the private repositories
81+
- name: basic-auth
82+
secret:
83+
secretName: "{{ git_auth_secret }}"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
apiVersion: tekton.dev/v1beta1
3+
kind: PipelineRun
4+
metadata:
5+
name: java-template
6+
annotations:
7+
# The event we are targeting as seen from the webhook payload
8+
# this can be an array too, i.e: [pull_request, push]
9+
pipelinesascode.tekton.dev/on-event: "pull_request"
10+
11+
# The branch or tag we are targeting (ie: main, refs/tags/*)
12+
pipelinesascode.tekton.dev/on-target-branch: "main"
13+
14+
# Fetch the git-clone task from hub, we are able to reference later on it
15+
# with taskRef and it will automatically be embedded into our pipeline.
16+
pipelinesascode.tekton.dev/task: "git-clone"
17+
18+
# You can add more tasks in here to reuse, browse the one you like from here
19+
# https://hub.tekton.dev/
20+
# example:
21+
# pipelinesascode.tekton.dev/task-2: "[maven, buildah]"
22+
23+
# How many runs we want to keep attached to this event
24+
pipelinesascode.tekton.dev/max-keep-runs: "5"
25+
spec:
26+
params:
27+
# The variable with brackets are special to Pipelines as Code
28+
# They will automatically be expanded with the events from Github.
29+
- name: repo_url
30+
value: "{{ repo_url }}"
31+
- name: revision
32+
value: "{{ revision }}"
33+
- name: image_name
34+
value: ""
35+
- name: app_name
36+
value: ""
37+
- name: path_context
38+
value: ""
39+
- name: version
40+
value: ""
41+
pipelineSpec:
42+
params:
43+
- name: repo_url
44+
- name: revision
45+
- name: image_name
46+
- name: app_name
47+
- name: path_context
48+
- name: version
49+
workspaces:
50+
- name: source
51+
- name: basic-auth
52+
tasks:
53+
- name: fetch-repository
54+
taskRef:
55+
name: git-clone
56+
workspaces:
57+
- name: output
58+
workspace: source
59+
- name: basic-auth
60+
workspace: basic-auth
61+
params:
62+
- name: url
63+
value: $(params.repo_url)
64+
- name: revision
65+
value: $(params.revision)
66+
- name: build
67+
params:
68+
- name: IMAGE
69+
value: $(params.image_name)
70+
- name: TLSVERIFY
71+
value: "false"
72+
- name: PATH_CONTEXT
73+
value: $(params.path_context)
74+
- name: VERSION
75+
value: $(params.version)
76+
runAfter:
77+
- fetch-repository
78+
taskRef:
79+
kind: ClusterTask
80+
name: s2i-java
81+
workspaces:
82+
- name: source
83+
workspace: source
84+
- name: deploy
85+
params:
86+
- name: SCRIPT
87+
value: oc rollout status deploy/$(params.app_name)
88+
runAfter:
89+
- build
90+
taskRef:
91+
kind: ClusterTask
92+
name: openshift-client
93+
workspaces:
94+
- name: workspace
95+
workspace: source
96+
97+
workspaces:
98+
- name: source
99+
volumeClaimTemplate:
100+
spec:
101+
accessModes:
102+
- ReadWriteOnce
103+
resources:
104+
requests:
105+
storage: 1Gi
106+
# This workspace will inject secret to help the git-clone task to be able to
107+
# checkout the private repositories
108+
- name: basic-auth
109+
secret:
110+
secretName: "{{ git_auth_secret }}"
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
apiVersion: tekton.dev/v1beta1
3+
kind: PipelineRun
4+
metadata:
5+
name: nodejs-template
6+
annotations:
7+
# The event we are targeting as seen from the webhook payload
8+
# this can be an array too, i.e: [pull_request, push]
9+
pipelinesascode.tekton.dev/on-event: "pull_request"
10+
11+
# The branch or tag we are targeting (ie: main, refs/tags/*)
12+
pipelinesascode.tekton.dev/on-target-branch: "main"
13+
14+
# Fetch the git-clone task from hub, we are able to reference later on it
15+
# with taskRef and it will automatically be embedded into our pipeline.
16+
pipelinesascode.tekton.dev/task: "git-clone"
17+
18+
19+
# Task for Nodejs
20+
pipelinesascode.tekton.dev/task-1: "[npm]"
21+
22+
# You can add more tasks in here to reuse, browse the one you like from here
23+
# https://hub.tekton.dev/
24+
# example:
25+
# pipelinesascode.tekton.dev/task-2: "[maven, buildah]"
26+
27+
# How many runs we want to keep attached to this event
28+
pipelinesascode.tekton.dev/max-keep-runs: "5"
29+
spec:
30+
params:
31+
# The variable with brackets are special to Pipelines as Code
32+
# They will automatically be expanded with the events from Github.
33+
- name: repo_url
34+
value: "{{ repo_url }}"
35+
- name: revision
36+
value: "{{ revision }}"
37+
pipelineSpec:
38+
params:
39+
- name: repo_url
40+
- name: revision
41+
workspaces:
42+
- name: source
43+
- name: basic-auth
44+
tasks:
45+
- name: fetch-repository
46+
taskRef:
47+
name: git-clone
48+
workspaces:
49+
- name: output
50+
workspace: source
51+
- name: basic-auth
52+
workspace: basic-auth
53+
params:
54+
- name: url
55+
value: $(params.repo_url)
56+
- name: revision
57+
value: $(params.revision)
58+
- name: run-test
59+
taskRef:
60+
name: npm
61+
workspaces:
62+
- name: source
63+
workspace: source
64+
params:
65+
- name: ARGS
66+
value:
67+
- test
68+
runAfter:
69+
- fetch-repository
70+
71+
workspaces:
72+
- name: source
73+
volumeClaimTemplate:
74+
spec:
75+
accessModes:
76+
- ReadWriteOnce
77+
resources:
78+
requests:
79+
storage: 1Gi
80+
# This workspace will inject secret to help the git-clone task to be able to
81+
# checkout the private repositories
82+
- name: basic-auth
83+
secret:
84+
secretName: "{{ git_auth_secret }}"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
apiVersion: tekton.dev/v1beta1
3+
kind: PipelineRun
4+
metadata:
5+
name: python-template
6+
annotations:
7+
# The event we are targeting as seen from the webhook payload
8+
# this can be an array too, i.e: [pull_request, push]
9+
pipelinesascode.tekton.dev/on-event: "pull_request"
10+
11+
# The branch or tag we are targeting (ie: main, refs/tags/*)
12+
pipelinesascode.tekton.dev/on-target-branch: "main"
13+
14+
# Fetch the git-clone task from hub, we are able to reference later on it
15+
# with taskRef and it will automatically be embedded into our pipeline.
16+
pipelinesascode.tekton.dev/task: "git-clone"
17+
18+
19+
# Task for Python
20+
pipelinesascode.tekton.dev/task-1: "[pylint]"
21+
22+
# You can add more tasks in here to reuse, browse the one you like from here
23+
# https://hub.tekton.dev/
24+
# example:
25+
# pipelinesascode.tekton.dev/task-2: "[maven, buildah]"
26+
27+
# How many runs we want to keep attached to this event
28+
pipelinesascode.tekton.dev/max-keep-runs: "5"
29+
spec:
30+
params:
31+
# The variable with brackets are special to Pipelines as Code
32+
# They will automatically be expanded with the events from Github.
33+
- name: repo_url
34+
value: "{{ repo_url }}"
35+
- name: revision
36+
value: "{{ revision }}"
37+
pipelineSpec:
38+
params:
39+
- name: repo_url
40+
- name: revision
41+
workspaces:
42+
- name: source
43+
- name: basic-auth
44+
tasks:
45+
- name: fetch-repository
46+
taskRef:
47+
name: git-clone
48+
workspaces:
49+
- name: output
50+
workspace: source
51+
- name: basic-auth
52+
workspace: basic-auth
53+
params:
54+
- name: url
55+
value: $(params.repo_url)
56+
- name: revision
57+
value: $(params.revision)
58+
- name: pylint
59+
taskRef:
60+
name: pylint
61+
runAfter:
62+
- fetch-repository
63+
workspaces:
64+
- name: source
65+
workspace: source
66+
67+
workspaces:
68+
- name: source
69+
volumeClaimTemplate:
70+
spec:
71+
accessModes:
72+
- ReadWriteOnce
73+
resources:
74+
requests:
75+
storage: 1Gi
76+
# This workspace will inject secret to help the git-clone task to be able to
77+
# checkout the private repositories
78+
- name: basic-auth
79+
secret:
80+
secretName: "{{ git_auth_secret }}"

0 commit comments

Comments
 (0)