---
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: s2i-ruby
  namespace: openshift
  labels:
    pipeline.openshift.io/runtime: ruby
  annotations:
    operator.tekton.dev/preserve-namespace: "true"
spec:
  params:
    - name: IMAGE_NAME
      type: string
  resources:
    - name: app-source
      type: git
    - name: app-image
      type: image

  tasks:
    - name: build
      taskRef:
        name: s2i-ruby
        kind: ClusterTask
      resources:
        inputs:
          - name: source
            resource: app-source
        outputs:
          - name: image
            resource: app-image
      params:
        - name: TLSVERIFY
          value: "false"

    - name: deploy
      taskRef:
        name: openshift-client
        kind: ClusterTask
      runAfter:
        - build
      params:
        - name: ARGS
          value: ["new-app", "--docker-image", "$(params.IMAGE_NAME)"]
