Skip to content

Instantly share code, notes, and snippets.

@praveen4g0
Created April 22, 2020 06:16
Show Gist options
  • Save praveen4g0/b2f08e66396e73609845ed6b10afb4f4 to your computer and use it in GitHub Desktop.
Save praveen4g0/b2f08e66396e73609845ed6b10afb4f4 to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: buildah-source-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: buildah-test-pipeline
spec:
workspaces:
- name: shared-workspace
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-workspace
params:
- name: url
value: https://github.com/kelseyhightower/nocode
- name: subdirectory
value: ""
- name: deleteExisting
value: "true"
- name: buildah
taskRef:
name: buildah
runAfter:
- fetch-repository
workspaces:
- name: source
workspace: shared-workspace
params:
- name: IMAGE
value: image-registry.openshift-image-registry.svc:5000/pthangad-v1beta1/nocode:latest
- name: TLSVERIFY
value: "false"
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: buildah-test-pipeline-run
spec:
pipelineRef:
name: buildah-test-pipeline
workspaces:
- name: shared-workspace
persistentvolumeclaim:
claimName: buildah-source-pvc
@praveen4g0
Copy link
Author

praveen4g0 commented Apr 22, 2020

Perform below steps to try out work spaces

  1. oc new-project pthangad-v1beta1
  2. oc apply -f https://raw.githubusercontent.com/tektoncd/catalog/v1beta1/git/git-clone.yaml
  3. oc apply -f https://raw.githubusercontent.com/tektoncd/catalog/v1beta1/buildah/buildah.yaml
  4. oc apply -f https://gist.githubusercontent.com/praveen4g0/b2f08e66396e73609845ed6b10afb4f4/raw/2099fd0b24986b8d1a9e09b4f977cda08a92d31a/buildah.yaml

use tkn cli to run pipeline
5. tkn pipeline start buildah-test-pipeline -w=name=shared-workspace,claimName=buildah-source-pvc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment