Skip to content

Instantly share code, notes, and snippets.

@kainlite
Created October 26, 2022 23:56
Show Gist options
  • Select an option

  • Save kainlite/feee09258150a21cd8c5c49170cff343 to your computer and use it in GitHub Desktop.

Select an option

Save kainlite/feee09258150a21cd8c5c49170cff343 to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: clone-build-push
namespace: tekton-pipelines
spec:
description: |
This pipeline clones a git repo, builds a Docker image with Kaniko and
pushes it to a registry
params:
- name: repo-url
type: string
- name: image-reference
type: string
workspaces:
- name: shared-data
- name: docker-credentials
tasks:
- name: fetch-source
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-data
params:
- name: url
value: $(params.repo-url)
- name: build-push
runAfter: ["fetch-source"]
taskRef:
name: kaniko
workspaces:
- name: source
workspace: shared-data
- name: dockerconfig
workspace: docker-credentials
params:
- name: IMAGE
value: $(params.image-reference)
- name: restart-deployment
runAfter: ["build-push"]
taskRef:
name: kubernetes-actions
params:
- name: script
value: |
kubectl -n tr rollout restart deployment/tr-deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment