---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  namespace: openshift
spec:
  params:
    - name: APP_NAME
      type: string
    - name: GIT_REPO
      type: string
    - name: GIT_REVISION
      type: string
    - name: IMAGE_NAME
      type: string
    - name: PATH_CONTEXT
      type: string
      default: .
  workspaces:
    - name: workspace

  tasks:
    - name: fetch-repository
      taskRef:
        name: git-clone
        kind: ClusterTask
      workspaces:
        - name: output
          workspace: workspace
      params:
        - name: url
          value: $(params.GIT_REPO)
        - name: revision
          value: $(params.GIT_REVISION)
        - name: subdirectory
          value: ""
        - name: deleteExisting
          value: "true"

    - name: build
      taskRef:
        kind: ClusterTask
      runAfter:
        - fetch-repository
      workspaces:
        - name: source
          workspace: workspace
      params:
        - name: IMAGE
          value: $(params.IMAGE_NAME)
        - name: TLSVERIFY
          value: "false"

    - name: deploy
