apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  name: pipeline-results
spec:
  tasks:
  - name: hello
    taskSpec:
      results:
      - name: url
      steps:
      - name: hello
        image: image-registry.openshift-image-registry.svc:5000/openshift/golang
        script: |
          echo "https://artifacts.mycompany.com/mypipelinerun/210908-111711/" > $(results.url.path)
          for i in $(seq 59 -1 1); do
            echo "[hello task] Sleeping for $i seconds..."
            sleep 1
          done
          echo "[hello task] Hello, Results!"
  - name: goodbye
    runAfter:
    - hello
    taskSpec:
      steps:
      - name: goodbye
        image: image-registry.openshift-image-registry.svc:5000/openshift/golang
        script: |
          for i in $(seq 29 -1 1); do
            echo "[goodbye task] Sleeping for $i seconds..."
            sleep 1
          done
          echo "[goodbye task] Goodbye, Results!"
  results:
  - name: artifacts-url
    value: $(tasks.hello.results.url)

