apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: clone-build-push
  namespace: col-ubi8-toolset-prod
spec:
  params:
  - name: git-url
    type: string
  - name: git-revision
    type: string
  - name: target-image
    type: string
  - name: buildah-context
    type: string
  - name: buildah-format
    type: string
  tasks:
  - name: fetch-from-git
    params:
    - name: url
      value: $(params.git-url)
    - name: revision
      value: $(params.git-revision)
    taskRef:
      kind: Task
      name: git-clone-suva
    workspaces:
    - name: output
      workspace: git-source
  - name: build-and-push
    params:
    - name: IMAGE
      value: $(params.target-image)
    - name: DOCKERFILE
      value: ./Dockerfile
    - name: CONTEXT
      value: $(params.buildah-context)
    - name: FORMAT
      value: $(params.buildah-format)
    runAfter:
    - fetch-from-git
    taskRef:
      kind: Task
      name: buildah-suva
    workspaces:
    - name: source
      workspace: git-source
    - name: sslcertdir
      workspace: suva-ca
  - name: pvc-cleanup-suva
    params:
    - name: MAX_PIPELINES
      value: "20"
    - name: RETENTION_DAYS
      value: "0"
    taskRef:
      kind: Task
      name: pvc-cleanup-suva
  workspaces:
  - name: git-source
  - name: suva-ca

