---
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: deploy-application
  namespace: tekton-pipeline-istio-project-1
spec:
  inputs:
    resources:
      - name: git-source
        type: git
  steps:
    - name: delete-old-deployment
      image: lachlanevenson/k8s-kubectl
      command: ["kubectl"]
      args:
        - "delete"
        - "-f"
        - "$(inputs.resources.git-source.path)/deploy.yaml"
    - name: deploy-new-app
      image: lachlanevenson/k8s-kubectl
      command: ["kubectl"]
      args:
        - "apply"
        - "-f"
        - "$(inputs.resources.git-source.path)/deploy.yaml"