# auto generated by script/update-tasks.sh
# DO NOT EDIT: use the script instead
# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.11/s2i/s2i.yaml
#
---
apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
  name: s2i
spec:
  params:
  - name: BUILDER_IMAGE
    description: The location of the s2i builder image.
  - name: PATH_CONTEXT
    description: The location of the path to run s2i from.
    default: .
  - name: TLSVERIFY
    description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)
    default: 'true'
  - name: LOGLEVEL
    description: Log level when running the S2I binary
    default: '0'
  resources:
    inputs:
      - name: source
        type: git
    outputs:
      - name: image
        type: image
  steps:
  - name: generate
    command:
    - /usr/local/bin/s2i
    - --loglevel=$(params.LOGLEVEL)
    - build
    - $(params.PATH_CONTEXT)
    - $(params.BUILDER_IMAGE)
    - --as-dockerfile
    - /gen-source/Dockerfile.gen
    image: registry.redhat.io/ocp-tools-43-tech-preview/source-to-image-rhel8
    volumeMounts:
    - mountPath: /gen-source
      name: gen-source
    workingDir: /workspace/source
  - name: build
    command:
    - buildah
    - bud
    - --tls-verify=$(params.TLSVERIFY)
    - --layers
    - -f
    - /gen-source/Dockerfile.gen
    - -t
    - $(resources.outputs.image.url)
    - .
    image: registry.redhat.io/rhel8/buildah
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /var/lib/containers
      name: varlibcontainers
    - mountPath: /gen-source
      name: gen-source
    workingDir: /gen-source
  - name: push
    command:
    - buildah
    - push
    - --tls-verify=$(params.TLSVERIFY)
    - $(resources.outputs.image.url)
    - docker://$(resources.outputs.image.url)
    image: registry.redhat.io/rhel8/buildah
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /var/lib/containers
      name: varlibcontainers
  volumes:
  - emptyDir: {}
    name: varlibcontainers
  - emptyDir: {}
    name: gen-source
