Tekton Pipeline Examples

Pre-requisites

Prepare Project

oc new-project pipeline-demo

# create service account

oc create serviceaccount pipeline
oc adm policy add-scc-to-user privileged -z pipeline
oc adm policy add-role-to-user edit -z pipeline

# create pipline tasks and resources

oc create -f tasks
oc create -f https://raw.githubusercontent.com/tektoncd/catalog/master/buildah/buildah.yaml
oc create -f https://raw.githubusercontent.com/tektoncd/catalog/master/openshift-client/openshift-client-task.yaml
oc create -f pipelines/mapit-resources.yml

MapIt Build Pipeline

oc create -f pipelines/build-pipeline.yml
tkn pipeline start build-pipeline -s pipeline

MapIt Deploy Pipeline

# deploy mapit
oc apply -f apps/mapit-spring.yml

# create pipeline
oc create -f pipelines/deploy-pipeline.yml
tkn pipeline start deploy-pipeline -s pipeline

PetClinic Pipeline Demo

On Kubernetes

kubectl apply -k demos/petclinic/k8s

On OpenShift

oc apply -k demos/petclinic/os --validate=false

Start the pipeline

tkn pipeline start petclinic-s2i-pipeline -s pipeline -n pipelines-demo