Skip to content

Instantly share code, notes, and snippets.

@zregvart
Created September 7, 2023 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zregvart/ae4170d97a25d1d4d214e45a6abf8b19 to your computer and use it in GitHub Desktop.
Save zregvart/ae4170d97a25d1d4d214e45a6abf8b19 to your computer and use it in GitHub Desktop.
# prerequisite:
# kubectl apply -f - <<EOF
# ---
# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: workspace
# spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 1Gi
# storageClassName: standard
# EOF
#
# run:
# tkn pipeline start -f pipeline.yaml -w name=work,claimName=workspace
---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: simple
spec:
tasks:
- name: checkout
params:
- name: url
value: https://github.com/enterprise-contract/golden-container.git
- name: revision
value: main
workspaces:
- name: output
workspace: work
taskRef:
resolver: git
params:
- name: url
value: https://github.com/tektoncd/catalog.git
- name: revision
value: main
- name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml
- name: build
params:
- name: IMAGE
value: registry.image-registry.svc.cluster.local:5000/work/simple
- name: DOCKERFILE
value: ./Containerfile
- name: CONTEXT
value: /workspace/source/
runAfter:
- checkout
workspaces:
- name: source
workspace: work
taskRef:
resolver: git
params:
- name: url
value: https://github.com/tektoncd/catalog.git
- name: revision
value: main
- name: pathInRepo
value: task/kaniko/0.6/kaniko.yaml
results:
- name: CHAINS-GIT_URL
value: $(tasks.checkout.results.url)
- name: CHAINS-GIT_COMMIT
value: $(tasks.checkout.results.commit)
- name: IMAGE_URL
value: $(tasks.build.results.IMAGE_URL)
- name: IMAGE_DIGEST
value: $(tasks.build.results.IMAGE_DIGEST)
workspaces:
- name: work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment