# 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/s2i-nodejs-pr/0.1/s2i-nodejs-pr.yaml
#
---
apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
  name: s2i-nodejs-pr
  labels:
    app.kubernetes.io/version: "0.1"
  annotations:
    tekton.dev/pipelines.minVersion: "0.11.3"
    tekton.dev/tags: s2i, nodejs
    tekton.dev/displayName: "s2i nodejs pipelineresource"
spec:
  description: >-
    s2i-nodejs-pr task fetches a Git repository and builds and
    pushes a container image using S2I and a nodejs builder image.

  params:
    - name: VERSION
      description: The version of the nodejs
      default: '12'
      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
  resources:
    inputs:
      - name: source
        type: git
    outputs:
      - name: image
        type: image
  steps:
    - name: generate
      image: registry.redhat.io/ocp-tools-43-tech-preview/source-to-image-rhel8
      workingDir: /workspace/source
      command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/nodejs:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen']
      volumeMounts:
        - name: gen-source
          mountPath: /gen-source
    - name: build
      image: registry.redhat.io/rhel8/buildah
      workingDir: /gen-source
      command: ['buildah', 'bud', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(resources.outputs.image.url)', '.']
      volumeMounts:
        - name: varlibcontainers
          mountPath: /var/lib/containers
        - name: gen-source
          mountPath: /gen-source
      securityContext:
        privileged: true
    - name: push
      image: registry.redhat.io/rhel8/buildah
      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: {}
    - name: gen-source
      emptyDir: {}
