Demo of Application Development with OpenShift
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

73 lines
1.7 KiB

apiVersion: v1
kind: ConfigMap
metadata:
name: pipelinerun-template
data:
template: |
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: demo-appdev-
spec:
serviceAccountName: tekton-robot
pipelineRef:
name: demo-appdev
params:
- name: gitRepositoryURL
value: https://github.com/nmasse-itix/demo-appdev.git
- name: outputContainerImage
value: image-registry.openshift-image-registry.svc:5000/demo-appdev/function
workspaces:
- name: scratch
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tekton-hook
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: tekton-hook
rules:
- apiGroups: ["tekton.dev"]
resources: ["pipelineruns"]
verbs: ["create"]
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tekton-hook
subjects:
- kind: ServiceAccount
name: tekton-hook
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: tekton-hook
---
apiVersion: batch/v1
kind: Job
metadata:
name: tekton-hook
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
template:
spec:
containers:
- name: oc
image: image-registry.openshift-image-registry.svc:5000/openshift/cli
command: ["/bin/sh", "-c", "oc get configmap pipelinerun-template -n demo-appdev -o 'jsonpath={.data.template}' | oc create -f - -n demo-appdev"]
restartPolicy: Never
serviceAccountName: tekton-hook