# auto generated by script/update-tasks.sh
# DO NOT EDIT: use the script instead
# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.22/task/s2i-perl/0.1/s2i-perl.yaml
#
---
apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
  name: s2i-perl
  labels:
    app.kubernetes.io/version: "0.1"
  annotations:
    tekton.dev/pipelines.minVersion: "0.19"
    tekton.dev/tags: s2i, perl, workspace
    tekton.dev/displayName: "s2i perl"
spec:
  description: >-
    s2i-perl task clones a Git repository and builds and
    pushes a container image using S2I and a Perl builder image.

  results:
    - name: IMAGE_DIGEST
      description: Digest of the image just built.
  params:
    - name: VERSION
      description: The tag of perl imagestream for perl version
      default: '5.30-ubi8'
      type: string
    - name: PATH_CONTEXT
      description: The location of the path to run s2i from.
      default: .
      type: string
    - name: TLSVERIFY
      description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)
      default: "true"
      type: string
    - name: IMAGE
      description: Location of the repo where image has to be pushed
      type: string
    - name: BUILDER_IMAGE
      description: The location of the buildah builder image.
      default: registry.redhat.io/rhel8/buildah@sha256:6a68ece207bc5fd8db2dd5cc2d0b53136236fb5178eb5b71eebe5d07a3c33d13
  workspaces:
    - name: source
      mountPath: /workspace/source
  steps:
    - name: generate
      image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:ba51e5e74ff5a29fd429b0bb77bc2130e5284826a60d042fc4e4374381a7a308
      workingDir: $(workspaces.source.path)
      command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/perl:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen']
      volumeMounts:
        - name: gen-source
          mountPath: /gen-source
    - name: build
      image: $(params.BUILDER_IMAGE)
      workingDir: /gen-source
      command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.']
      volumeMounts:
        - name: varlibcontainers
          mountPath: /var/lib/containers
        - name: gen-source
          mountPath: /gen-source
    - name: push
      workingDir: $(workspaces.source.path)
      image: $(params.BUILDER_IMAGE)
      command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)']
      volumeMounts:
        - name: varlibcontainers
          mountPath: /var/lib/containers
    - name: digest-to-results
      image: $(params.BUILDER_IMAGE)
      script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST
  volumes:
    - name: varlibcontainers
      emptyDir: {}
    - name: gen-source
      emptyDir: {}
