26 lines
804 B
YAML
26 lines
804 B
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: kubectl-patch-image
|
|
namespace: tekton-pipelines
|
|
spec:
|
|
params:
|
|
- name: NAMESPACE
|
|
default: "default"
|
|
description: The namespace the kubernetes resource is in
|
|
- name: RESOURCE_TYPE
|
|
default: "deployment"
|
|
description: The type of Kubernetes resource
|
|
- name: NAME
|
|
description: The name of the resource
|
|
- name: CONTAINER_NAME
|
|
description: The name of the container to patch
|
|
default: "*" # defaults to updating _all_ containers
|
|
- name: IMAGE
|
|
description: The new image to use
|
|
steps:
|
|
- name: kubectl-patch-image
|
|
image: gcr.io/cloud-builders/kubectl
|
|
script: |
|
|
kubectl --namespace $(params.NAMESPACE) set image $(params.RESOURCE_TYPE) $(params.NAME) $(params.CONTAINER_NAME)=$(params.IMAGE)
|