# auto generated by script/update-tasks.sh
# DO NOT EDIT: use the script instead
# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/v0.14.3/task/buildah-pr/0.1/buildah-pr.yaml
#
---
apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
  name: buildah-pr-v0-14-3
  labels:
    app.kubernetes.io/version: "0.1"
  annotations:
    tekton.dev/pipelines.minVersion: "0.14.3"
    tekton.dev/tags: buildah
    tekton.dev/displayName: "buildah pipelineresource"
spec:
  description: >-
    Buildah task builds source into a container image and
    then pushes it to a container registry.

    Buildah Task builds source into a container image using Project Atomic's
    Buildah build tool.It uses Buildah's support for building from Dockerfiles,
    using its buildah bud command.This command executes the directives in the
    Dockerfile to assemble a container image, then pushes that image to a
    container registry.

  params:
    - name: BUILDER_IMAGE
      description: The location of the buildah builder image.
      default: registry.redhat.io/rhel8/buildah
    - name: DOCKERFILE
      description: Path to the Dockerfile to build.
      default: ./Dockerfile
    - name: CONTEXT
      description: Path to the directory to use as context.
      default: .
    - name: TLSVERIFY
      description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)
      default: "true"
    - name: FORMAT
      description: The format of the built container, oci or docker
      default: "oci"
  resources:
    inputs:
      - name: source
        type: git
    outputs:
      - name: image
        type: image

  steps:
    - name: build
      image: $(params.BUILDER_IMAGE)
      workingDir: /workspace/source
      command: ['buildah', 'bud', '--format=$(params.FORMAT)', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '$(params.DOCKERFILE)', '-t', '$(resources.outputs.image.url)', '$(params.CONTEXT)']
      volumeMounts:
        - name: varlibcontainers
          mountPath: /var/lib/containers
      securityContext:
        privileged: true

    - name: push
      image: $(params.BUILDER_IMAGE)
      workingDir: /workspace/source
      command: ['buildah', 'push', '--tls-verify=$(params.TLSVERIFY)', '$(resources.outputs.image.url)', 'docker://$(resources.outputs.image.url)']
      volumeMounts:
        - name: varlibcontainers
          mountPath: /var/lib/containers
      securityContext:
        privileged: true

  volumes:
    - name: varlibcontainers
      emptyDir: {}
