apiVersion: tekton.dev/v1
kind: Task
metadata:
  annotations:
    artifacthub.io/category: integration-delivery
    artifacthub.io/maintainers: |
      - name: OpenShift Pipeline task maintainers
        email: pipelines-extcomm@redhat.com
    artifacthub.io/provider: Red Hat
    artifacthub.io/recommendations: |
      - url: https://tekton.dev/
    operator.tekton.dev/last-applied-hash: b0573889da739d5723af9b7a81a93bd5f63e7c45d821c5edc9082bc54699713f
    tekton.dev/categories: containers
    tekton.dev/pipelines.minVersion: 0.41.0
    tekton.dev/source: https://github.com/openshift-pipelines/task-containers
    tekton.dev/tags: containers
  creationTimestamp: "2024-06-10T13:45:47Z"
  generation: 1
  labels:
    app.kubernetes.io/version: 0.3.1
    operator.tekton.dev/operand-name: openshift-pipelines-addons
    operator.tekton.dev/provider-type: redhat
  name: s2i-python
  namespace: openshift-pipelines
  ownerReferences:
  - apiVersion: operator.tekton.dev/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: TektonInstallerSet
    name: addon-custom-resolvertask-4w7k4
    uid: 44cc2eb3-48d8-4e6c-82ef-203759a9a88b
  resourceVersion: "38867"
  uid: 9ae84132-36ec-4d71-9d14-5a1c96dfb329
spec:
  description: |
    Builds the source code using the s2i's Python builder-image
    "registry.access.redhat.com/ubi8/python-39:latest".
  params:
  - description: |
      Fully qualified container image name to be built by s2i.
    name: IMAGE
    type: string
  - default: image:///usr/libexec/s2i
    description: |
      Specify a URL containing the default assemble and run scripts for the builder image
    name: IMAGE_SCRIPTS_URL
    type: string
  - default: []
    description: |
      Array containing string of Environment Variables as "KEY=VALUE"
    name: ENV_VARS
    type: array
  - default: .
    description: |
      Path to the directory to use as context.
    name: CONTEXT
    type: string
  - default: vfs
    description: |
      Set buildah storage driver to reflect the currrent cluster node's
      settings.
    name: STORAGE_DRIVER
    type: string
  - default: oci
    description: The format of the built container, oci or docker
    name: FORMAT
    type: string
  - default: ""
    description: |
      Extra parameters passed for the build command when building images.
    name: BUILD_EXTRA_ARGS
    type: string
  - default: ""
    description: |
      Extra parameters passed for the push command when pushing images.
    name: PUSH_EXTRA_ARGS
    type: string
  - default: "false"
    description: |
      Skip pushing the image to the container registry.
    name: SKIP_PUSH
    type: string
  - default: "true"
    description: |
      Sets the TLS verification flag, `true` is recommended.
    name: TLS_VERIFY
    type: string
  - default: "false"
    description: |
      Turns on verbose logging, all commands executed will be printed out.
    name: VERBOSE
    type: string
  results:
  - description: |
      Fully qualified image name.
    name: IMAGE_URL
    type: string
  - description: |
      Digest of the image just built.
    name: IMAGE_DIGEST
    type: string
  stepTemplate:
    computeResources: {}
    env:
    - name: PARAMS_IMAGE
      value: $(params.IMAGE)
    - name: PARAMS_IMAGE_SCRIPTS_URL
      value: $(params.IMAGE_SCRIPTS_URL)
    - name: PARAMS_CONTEXT
      value: $(params.CONTEXT)
    - name: PARAMS_FORMAT
      value: $(params.FORMAT)
    - name: PARAMS_STORAGE_DRIVER
      value: $(params.STORAGE_DRIVER)
    - name: PARAMS_BUILD_EXTRA_ARGS
      value: $(params.BUILD_EXTRA_ARGS)
    - name: PARAMS_PUSH_EXTRA_ARGS
      value: $(params.PUSH_EXTRA_ARGS)
    - name: PARAMS_SKIP_PUSH
      value: $(params.SKIP_PUSH)
    - name: PARAMS_TLS_VERIFY
      value: $(params.TLS_VERIFY)
    - name: PARAMS_VERBOSE
      value: $(params.VERBOSE)
    - name: WORKSPACES_SOURCE_BOUND
      value: $(workspaces.source.bound)
    - name: WORKSPACES_SOURCE_PATH
      value: $(workspaces.source.path)
    - name: WORKSPACES_DOCKERCONFIG_BOUND
      value: $(workspaces.dockerconfig.bound)
    - name: WORKSPACES_DOCKERCONFIG_PATH
      value: $(workspaces.dockerconfig.path)
    - name: RESULTS_IMAGE_URL_PATH
      value: $(results.IMAGE_URL.path)
    - name: RESULTS_IMAGE_DIGEST_PATH
      value: $(results.IMAGE_DIGEST.path)
  steps:
  - computeResources: {}
    image: registry.access.redhat.com/ubi8-minimal:8.9
    name: load-scripts
    script: |
      set -e
      printf '%s' "IyEvdXNyL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ZXMgYXJlIGV4cG9yZXRlZCBvbiB0aGUgZW52aXJvbm1lbnQKZnVuY3Rpb24gZXhwb3J0ZWRfb3JfZmFpbCgpIHsKICAgIGRlY2xhcmUgLWEgX3JlcXVpcmVkX3ZhcnM9IiR7QH0iCgogICAgZm9yIHYgaW4gJHtfcmVxdWlyZWRfdmFyc1tAXX07IGRvCiAgICAgICAgW1sgLXogIiR7IXZ9IiBdXSAmJgogICAgICAgICAgICBmYWlsICInJHt2fScgZW52aXJvbm1lbnQgdmFyaWFibGUgaXMgbm90IHNldCEiCiAgICBkb25lCgogICAgcmV0dXJuIDAKfQo=" |base64 -d >common.sh
      chmod +x buildah-*.sh
      printf '%s' "IyEvdXNyL2Jpbi9lbnYgYmFzaAoKIyB0ZWt0b24ncyBob21lIGRpcmVjdG9yeQpkZWNsYXJlIC1yeCBURUtUT05fSE9NRT0iJHtURUtUT05fSE9NRTotL3Rla3Rvbi9ob21lfSIKCiMKIyBGdW5jdGlvbnMKIwoKZnVuY3Rpb24gZmFpbCgpIHsKICAgIGVjaG8gIkVSUk9SOiAkeyp9IiAyPiYxCiAgICBleGl0IDEKfQoKZnVuY3Rpb24gcGhhc2UoKSB7CiAgICBlY2hvICItLS0+IFBoYXNlOiAkeyp9Li4uIgp9CgojIGFzc2VydCBsb2NhbCB2YXJpYWJsZXMgYXJlIGV4cG9yZXRlZCBvbiB0aGUgZW52aXJvbm1lbnQKZnVuY3Rpb24gZXhwb3J0ZWRfb3JfZmFpbCgpIHsKICAgIGRlY2xhcmUgLWEgX3JlcXVpcmVkX3ZhcnM9IiR7QH0iCgogICAgZm9yIHYgaW4gJHtfcmVxdWlyZWRfdmFyc1tAXX07IGRvCiAgICAgICAgW1sgLXogIiR7IXZ9IiBdXSAmJgogICAgICAgICAgICBmYWlsICInJHt2fScgZW52aXJvbm1lbnQgdmFyaWFibGUgaXMgbm90IHNldCEiCiAgICBkb25lCgogICAgcmV0dXJuIDAKfQo=" |base64 -d >common.sh
      printf '%s' "IyE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VuZXJhdGUKIwoKcGhhc2UgIkdlbmVyYXRpbmcgdGhlIERvY2tlcmZpbGUgZm9yIFMySSBidWlsZGVyIGltYWdlICcke1MySV9CVUlMREVSX0lNQUdFfSciCnMyaSAtLWxvZ2xldmVsICIke1MySV9MT0dMRVZFTH0iIFwKICAgIGJ1aWxkICIke1BBUkFNU19DT05URVhUfSIgIiR7UzJJX0JVSUxERVJfSU1BR0V9IiBcCiAgICAgICAgLS1pbWFnZS1zY3JpcHRzLXVybCAiJHtQQVJBTVNfSU1BR0VfU0NSSVBUU19VUkx9IiBcCiAgICAgICAgLS1hcy1kb2NrZXJmaWxlICIke1MySV9ET0NLRVJGSUxFfSIgXAogICAgICAgIC0tZW52aXJvbm1lbnQtZmlsZSAiJHtTMklfRU5WSVJPTk1FTlRfRklMRX0iCgpwaGFzZSAiSW5zcGVjdGluZyB0aGUgRG9ja2VyZmlsZSBnZW5lcmF0ZWQgYXQgJyR7UzJJX0RPQ0tFUkZJTEV9JyIKW1sgISAtZiAiJHtTMklfRE9DS0VSRklMRX0iIF1dICYmCiAgICBmYWlsICJHZW5lcmF0ZWQgRG9ja2VyZmlsZSBpcyBub3QgZm91bmQhIgoKc2V0ICt4CnBoYXNlICJHZW5lcmF0ZWQgRG9ja2VyZmlsZSBwYXlsb2FkIgplY2hvIC1lbiAiPj4+ICR7UzJJX0RPQ0tFUkZJTEV9XG4kKGNhdCAke1MySV9ET0NLRVJGSUxFfSlcbjw8PCBFT0ZcbiIK" |base64 -d >s2i-generate.sh
      chmod +x s2i-*.sh
    volumeMounts:
    - mountPath: /scripts
      name: scripts-dir
    workingDir: /scripts
  - args:
    - $(params.ENV_VARS[*])
    command:
    - /scripts/s2i-generate.sh
    computeResources: {}
    env:
    - name: S2I_BUILDER_IMAGE
      value: registry.access.redhat.com/ubi8/python-39:latest
    image: registry.access.redhat.com/source-to-image/source-to-image-rhel8:v1.3.9-6
    name: s2i-generate
    securityContext:
      capabilities:
        add:
        - SETFCAP
    volumeMounts:
    - mountPath: /scripts
      name: scripts-dir
    - mountPath: /s2i-generate
      name: s2i-generate-dir
    workingDir: $(workspaces.source.path)
  - command:
    - /scripts/s2i-build.sh
    computeResources: {}
    image: registry.access.redhat.com/ubi8/buildah:8.9
    name: s2i-build
    securityContext:
      capabilities:
        add:
        - SETFCAP
    volumeMounts:
    - mountPath: /scripts
      name: scripts-dir
    - mountPath: /s2i-generate
      name: s2i-generate-dir
    workingDir: /s2i-generate
  volumes:
  - emptyDir: {}
    name: scripts-dir
  - emptyDir: {}
    name: s2i-generate-dir
  workspaces:
  - description: |
      Application source code, the build context for S2I workflow.
    name: source
  - description: An optional workspace that allows providing a .docker/config.json
      file for Buildah to access the container registry. The file should be placed
      at the root of the Workspace with name config.json.
    name: dockerconfig
    optional: true
