Adding pipeline as code .tekton directory

This commit is contained in:
Lester Claudio 2023-11-09 08:25:54 -07:00
parent bf12157061
commit 77bc7e5bfc

81
.tekton/pipelinerun.yaml Normal file
View file

@ -0,0 +1,81 @@
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: spring-petclinic
annotations:
# The event we are targeting as seen from the webhook payload
# this can be an array too, i.e: [pull_request, push]
pipelinesascode.tekton.dev/on-event: "[pull_request, push]"
# The branch or tag we are targeting (ie: main, refs/tags/*)
pipelinesascode.tekton.dev/on-target-branch: "[main]"
# Fetch the git-clone task from hub, we are able to reference later on it
# with taskRef and it will automatically be embedded into our pipeline.
pipelinesascode.tekton.dev/task: "git-clone"
# You can add more tasks by increasing the suffix number, you can specify
# them as array to have multiple of them.
# browse the tasks you want to include from hub on https://hub.tekton.dev/
#
# pipelinesascode.tekton.dev/task-2: "[curl, buildah]"
# How many runs we want to keep attached to this event
pipelinesascode.tekton.dev/max-keep-runs: "5"
spec:
params:
# The variable with brackets are special to Pipelines as Code
# They will automatically be expanded with the events from Github.
- name: repo_url
value: "{{ repo_url }}"
- name: revision
value: "{{ revision }}"
pipelineSpec:
params:
- name: repo_url
- name: revision
- name: image_name
workspaces:
- name: source
- name: basic-auth
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: source
- name: basic-auth
workspace: basic-auth
params:
- name: url
value: $(params.repo_url)
- name: revision
value: $(params.revision)
- name: maven-test
taskRef:
name: maven
runAfter:
- fetch-repository
params:
- name: GOALS
value:
- test
workspaces:
- name: source
workspace: source
workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
# This workspace will inject secret to help the git-clone task to be able to
# checkout the private repositories
- name: basic-auth
secret:
secretName: "{{ git_auth_secret }}"