apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: fetch-component-nightly-releases
spec:
  workspaces:
  - name: source
    mountPath: /go/src/github.com/tektoncd/operator
  steps:
  - name: fetch-component-nightlies
    image: docker.io/curlimages/curl:7.75.0
    securityContext:
      runAsUser: 0
    script: |
      #!/usr/bin/env sh
      set -ex
      cd /go/src/github.com/tektoncd/operator
      components="pipeline trigger dashboard"
      for component in ${components}; do
        componentPath=cmd/kubernetes/operator/kodata/tekton-${component}
        rm -rf ${componentPath}/*
        mkdir -p ${componentPath}/nightly
        if [[ ${component} == "dashboard" ]]; then
          curl -L -o ${componentPath}/nightly/release.notags.yaml https://storage.googleapis.com/tekton-releases-nightly/${component}/latest/tekton-dashboard-release.yaml
          sed -i '/aggregationRule/,+3d' ${componentPath}/nightly/release.notags.yaml
          continue
        fi
        curl -L -o ${componentPath}/nightly/release.notags.yaml https://storage.googleapis.com/tekton-releases-nightly/${component}/latest/release.notags.yaml
      done
      find cmd/kubernetes/operator/kodata/

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: fetch-component-nightly-releases
spec:
  workspaces:
  - name: source
    mountPath: /go/src/github.com/tektoncd/operator
  steps:
  - name: fetch-component-nightlies
    image: docker.io/curlimages/curl:7.75.0
    securityContext:
      runAsUser: 0
    script: |
      #!/usr/bin/env sh
      set -ex
      cd /go/src/github.com/tektoncd/operator
      components="pipeline trigger dashboard"
      for component in ${components}; do
        componentPath=cmd/kubernetes/operator/kodata/tekton-${component}
        rm -rf ${componentPath}/*
        mkdir -p ${componentPath}/0.0.0-nightly
        if [[ ${component} == "dashboard" ]]; then
          curl -L -o ${componentPath}/nightly/release.notags.yaml https://storage.googleapis.com/tekton-releases-nightly/${component}/latest/tekton-dashboard-release.yaml
          sed -i '/aggregationRule/,+3d' ${componentPath}/nightly/release.notags.yaml
          continue
        fi
        curl -L -o ${componentPath}/nightly/release.notags.yaml https://storage.googleapis.com/tekton-releases-nightly/${component}/latest/release.notags.yaml
      done
      find cmd/kubernetes/operator/kodata/

Fix operator nightly payload version naming
Fix operator nightly payload version naming

Use a valid semver version `0.0.0-nightly` for now. We can
find a better alternative later.

Signed-off-by: Nikhil Thomas <06117e966d039194d106149e879b10e553143831@redhat.com>
