diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4d4b6128ae..7958c45c00 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -205,7 +205,7 @@ You can edit the script to mention the specific version of the task or to add a Then all the tasks mentioned in the script can be added to codebase using ```shell -./hack/openshift/update-tasks.sh release-v0.22 cmd/openshift/operator/kodata/tekton-addon/1.4.0 v0.22.0 +./hack/openshift/fetch-tektoncd-catalog-tasks.sh cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_external ``` ## Running Codegen diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/buildah/buildah-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/buildah/buildah-1-6-0-task.yaml deleted file mode 100644 index 00f16301b4..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/buildah/buildah-1-6-0-task.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.24/task/buildah/0.1/buildah.yaml -# ---- ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: buildah-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/tags: image-build -spec: - description: >- - Buildah task builds source into a container image and - then pushes it to a container registry. - - Buildah Task builds source into a container image using Project Atomic's - Buildah build tool.It uses Buildah's support for building from Dockerfiles, - using its buildah bud command.This command executes the directives in the - Dockerfile to assemble a container image, then pushes that image to a - container registry. - - params: - - name: IMAGE - description: Reference of the image buildah will produce. - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - - name: STORAGE_DRIVER - description: Set buildah storage driver - default: vfs - - name: DOCKERFILE - description: Path to the Dockerfile to build. - default: ./Dockerfile - - name: CONTEXT - description: Path to the directory to use as context. - default: . - - name: TLSVERIFY - description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) - default: "true" - - name: FORMAT - description: The format of the built container, oci or docker - default: "oci" - - name: BUILD_EXTRA_ARGS - description: Extra parameters passed for the build command when building images. - default: "" - - name: PUSH_EXTRA_ARGS - description: Extra parameters passed for the push command when pushing images. - type: string - default: "" - workspaces: - - name: source - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - - steps: - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: $(workspaces.source.path) - script: | - buildah --storage-driver=$(params.STORAGE_DRIVER) bud \ - $(params.BUILD_EXTRA_ARGS) --format=$(params.FORMAT) \ - --tls-verify=$(params.TLSVERIFY) --no-cache \ - -f $(params.DOCKERFILE) -t $(params.IMAGE) $(params.CONTEXT) - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - - name: push - image: $(params.BUILDER_IMAGE) - workingDir: $(workspaces.source.path) - script: | - buildah --storage-driver=$(params.STORAGE_DRIVER) push \ - $(params.PUSH_EXTRA_ARGS) --tls-verify=$(params.TLSVERIFY) \ - --digestfile $(workspaces.source.path)/image-digest $(params.IMAGE) \ - docker://$(params.IMAGE) - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - - volumes: - - name: varlibcontainers - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/git-clone/git-clone-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/git-clone/git-clone-1-6-0-task.yaml deleted file mode 100644 index 850959e867..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/git-clone/git-clone-1-6-0-task.yaml +++ /dev/null @@ -1,219 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/git-clone/0.4/git-clone.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: git-clone-1-6-0 - labels: - app.kubernetes.io/version: "0.4" - annotations: - tekton.dev/pipelines.minVersion: "0.21.0" - tekton.dev/categories: Git - tekton.dev/tags: git - tekton.dev/displayName: "git clone" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - These Tasks are Git tasks to work with repositories used by other tasks - in your Pipeline. - - The git-clone Task will clone a repo from the provided url into the - output Workspace. By default the repo will be cloned into the root of - your Workspace. You can clone into a subdirectory by setting this Task's - subdirectory param. This Task also supports sparse checkouts. To perform - a sparse checkout, pass a list of comma separated directory patterns to - this Task's sparseCheckoutDirectories param. - workspaces: - - name: output - description: The git repo will be cloned onto the volume backing this Workspace. - - name: ssh-directory - optional: true - description: | - A .ssh directory with private key, known_hosts, config, etc. Copied to - the user's home before git commands are executed. Used to authenticate - with the git remote when performing the clone. Binding a Secret to this - Workspace is strongly recommended over other volume types. - - name: basic-auth - optional: true - description: | - A Workspace containing a .gitconfig and .git-credentials file. These - will be copied to the user's home before any git commands are run. Any - other files in this Workspace are ignored. It is strongly recommended - to use ssh-directory over basic-auth whenever possible and to bind a - Secret to this Workspace over other volume types. - params: - - name: url - description: Repository URL to clone from. - type: string - - name: revision - description: Revision to checkout. (branch, tag, sha, ref, etc...) - type: string - default: "" - - name: refspec - description: Refspec to fetch before checking out revision. - default: "" - - name: submodules - description: Initialize and fetch git submodules. - type: string - default: "true" - - name: depth - description: Perform a shallow clone, fetching only the most recent N commits. - type: string - default: "1" - - name: sslVerify - description: Set the `http.sslVerify` global git config. Setting this to `false` is not advised unless you are sure that you trust your git remote. - type: string - default: "true" - - name: subdirectory - description: Subdirectory inside the `output` Workspace to clone the repo into. - type: string - default: "" - - name: sparseCheckoutDirectories - description: Define the directory patterns to match or exclude when performing a sparse checkout. - type: string - default: "" - - name: deleteExisting - description: Clean out the contents of the destination directory if it already exists before cloning. - type: string - default: "true" - - name: httpProxy - description: HTTP proxy server for non-SSL requests. - type: string - default: "" - - name: httpsProxy - description: HTTPS proxy server for SSL requests. - type: string - default: "" - - name: noProxy - description: Opt out of proxying HTTP/HTTPS requests. - type: string - default: "" - - name: verbose - description: Log the commands that are executed during `git-clone`'s operation. - type: string - default: "true" - - name: gitInitImage - description: The image providing the git-init binary that this Task runs. - type: string - default: "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.21.0" - - name: userHome - description: | - Absolute path to the user's home directory. Set this explicitly if you are running the image as a non-root user or have overridden - the gitInitImage param with an image containing custom user configuration. - type: string - default: "/tekton/home" - results: - - name: commit - description: The precise commit SHA that was fetched by this Task. - - name: url - description: The precise URL that was fetched by this Task. - steps: - - name: clone - image: "$(params.gitInitImage)" - env: - - name: HOME - value: "$(params.userHome)" - - name: PARAM_URL - value: $(params.url) - - name: PARAM_REVISION - value: $(params.revision) - - name: PARAM_REFSPEC - value: $(params.refspec) - - name: PARAM_SUBMODULES - value: $(params.submodules) - - name: PARAM_DEPTH - value: $(params.depth) - - name: PARAM_SSL_VERIFY - value: $(params.sslVerify) - - name: PARAM_SUBDIRECTORY - value: $(params.subdirectory) - - name: PARAM_DELETE_EXISTING - value: $(params.deleteExisting) - - name: PARAM_HTTP_PROXY - value: $(params.httpProxy) - - name: PARAM_HTTPS_PROXY - value: $(params.httpsProxy) - - name: PARAM_NO_PROXY - value: $(params.noProxy) - - name: PARAM_VERBOSE - value: $(params.verbose) - - name: PARAM_SPARSE_CHECKOUT_DIRECTORIES - value: $(params.sparseCheckoutDirectories) - - name: PARAM_USER_HOME - value: $(params.userHome) - - name: WORKSPACE_OUTPUT_PATH - value: $(workspaces.output.path) - - name: WORKSPACE_SSH_DIRECTORY_BOUND - value: $(workspaces.ssh-directory.bound) - - name: WORKSPACE_SSH_DIRECTORY_PATH - value: $(workspaces.ssh-directory.path) - - name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND - value: $(workspaces.basic-auth.bound) - - name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH - value: $(workspaces.basic-auth.path) - script: | - #!/usr/bin/env sh - set -eu - - if [ "${PARAM_VERBOSE}" = "true" ] ; then - set -x - fi - - if [ "${WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND}" = "true" ] ; then - cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" "${PARAM_USER_HOME}/.git-credentials" - cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.gitconfig" "${PARAM_USER_HOME}/.gitconfig" - chmod 400 "${PARAM_USER_HOME}/.git-credentials" - chmod 400 "${PARAM_USER_HOME}/.gitconfig" - fi - - if [ "${WORKSPACE_SSH_DIRECTORY_BOUND}" = "true" ] ; then - cp -R "${WORKSPACE_SSH_DIRECTORY_PATH}" "${PARAM_USER_HOME}"/.ssh - chmod 700 "${PARAM_USER_HOME}"/.ssh - chmod -R 400 "${PARAM_USER_HOME}"/.ssh/* - fi - - CHECKOUT_DIR="${WORKSPACE_OUTPUT_PATH}/${PARAM_SUBDIRECTORY}" - - cleandir() { - # Delete any existing contents of the repo directory if it exists. - # - # We don't just "rm -rf ${CHECKOUT_DIR}" because ${CHECKOUT_DIR} might be "/" - # or the root of a mounted volume. - if [ -d "${CHECKOUT_DIR}" ] ; then - # Delete non-hidden files and directories - rm -rf "${CHECKOUT_DIR:?}"/* - # Delete files and directories starting with . but excluding .. - rm -rf "${CHECKOUT_DIR}"/.[!.]* - # Delete files and directories starting with .. plus any other character - rm -rf "${CHECKOUT_DIR}"/..?* - fi - } - - if [ "${PARAM_DELETE_EXISTING}" = "true" ] ; then - cleandir - fi - - test -z "${PARAM_HTTP_PROXY}" || export HTTP_PROXY="${PARAM_HTTP_PROXY}" - test -z "${PARAM_HTTPS_PROXY}" || export HTTPS_PROXY="${PARAM_HTTPS_PROXY}" - test -z "${PARAM_NO_PROXY}" || export NO_PROXY="${PARAM_NO_PROXY}" - - /ko-app/git-init \ - -url="${PARAM_URL}" \ - -revision="${PARAM_REVISION}" \ - -refspec="${PARAM_REFSPEC}" \ - -path="${CHECKOUT_DIR}" \ - -sslVerify="${PARAM_SSL_VERIFY}" \ - -submodules="${PARAM_SUBMODULES}" \ - -depth="${PARAM_DEPTH}" \ - -sparseCheckoutDirectories="${PARAM_SPARSE_CHECKOUT_DIRECTORIES}" - cd "${CHECKOUT_DIR}" - RESULT_SHA="$(git rev-parse HEAD)" - EXIT_CODE="$?" - if [ "${EXIT_CODE}" != 0 ] ; then - exit "${EXIT_CODE}" - fi - printf "%s" "${RESULT_SHA}" > "$(results.commit.path)" - printf "%s" "${PARAM_URL}" > "$(results.url.path)" diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/git-clone/git-clone-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/git-clone/git-clone-task.yaml deleted file mode 100644 index e5ace49c5a..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/git-clone/git-clone-task.yaml +++ /dev/null @@ -1,219 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/git-clone/0.4/git-clone.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: git-clone - labels: - app.kubernetes.io/version: "0.4" - annotations: - tekton.dev/pipelines.minVersion: "0.21.0" - tekton.dev/categories: Git - tekton.dev/tags: git - tekton.dev/displayName: "git clone" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - These Tasks are Git tasks to work with repositories used by other tasks - in your Pipeline. - - The git-clone Task will clone a repo from the provided url into the - output Workspace. By default the repo will be cloned into the root of - your Workspace. You can clone into a subdirectory by setting this Task's - subdirectory param. This Task also supports sparse checkouts. To perform - a sparse checkout, pass a list of comma separated directory patterns to - this Task's sparseCheckoutDirectories param. - workspaces: - - name: output - description: The git repo will be cloned onto the volume backing this Workspace. - - name: ssh-directory - optional: true - description: | - A .ssh directory with private key, known_hosts, config, etc. Copied to - the user's home before git commands are executed. Used to authenticate - with the git remote when performing the clone. Binding a Secret to this - Workspace is strongly recommended over other volume types. - - name: basic-auth - optional: true - description: | - A Workspace containing a .gitconfig and .git-credentials file. These - will be copied to the user's home before any git commands are run. Any - other files in this Workspace are ignored. It is strongly recommended - to use ssh-directory over basic-auth whenever possible and to bind a - Secret to this Workspace over other volume types. - params: - - name: url - description: Repository URL to clone from. - type: string - - name: revision - description: Revision to checkout. (branch, tag, sha, ref, etc...) - type: string - default: "" - - name: refspec - description: Refspec to fetch before checking out revision. - default: "" - - name: submodules - description: Initialize and fetch git submodules. - type: string - default: "true" - - name: depth - description: Perform a shallow clone, fetching only the most recent N commits. - type: string - default: "1" - - name: sslVerify - description: Set the `http.sslVerify` global git config. Setting this to `false` is not advised unless you are sure that you trust your git remote. - type: string - default: "true" - - name: subdirectory - description: Subdirectory inside the `output` Workspace to clone the repo into. - type: string - default: "" - - name: sparseCheckoutDirectories - description: Define the directory patterns to match or exclude when performing a sparse checkout. - type: string - default: "" - - name: deleteExisting - description: Clean out the contents of the destination directory if it already exists before cloning. - type: string - default: "true" - - name: httpProxy - description: HTTP proxy server for non-SSL requests. - type: string - default: "" - - name: httpsProxy - description: HTTPS proxy server for SSL requests. - type: string - default: "" - - name: noProxy - description: Opt out of proxying HTTP/HTTPS requests. - type: string - default: "" - - name: verbose - description: Log the commands that are executed during `git-clone`'s operation. - type: string - default: "true" - - name: gitInitImage - description: The image providing the git-init binary that this Task runs. - type: string - default: "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.21.0" - - name: userHome - description: | - Absolute path to the user's home directory. Set this explicitly if you are running the image as a non-root user or have overridden - the gitInitImage param with an image containing custom user configuration. - type: string - default: "/tekton/home" - results: - - name: commit - description: The precise commit SHA that was fetched by this Task. - - name: url - description: The precise URL that was fetched by this Task. - steps: - - name: clone - image: "$(params.gitInitImage)" - env: - - name: HOME - value: "$(params.userHome)" - - name: PARAM_URL - value: $(params.url) - - name: PARAM_REVISION - value: $(params.revision) - - name: PARAM_REFSPEC - value: $(params.refspec) - - name: PARAM_SUBMODULES - value: $(params.submodules) - - name: PARAM_DEPTH - value: $(params.depth) - - name: PARAM_SSL_VERIFY - value: $(params.sslVerify) - - name: PARAM_SUBDIRECTORY - value: $(params.subdirectory) - - name: PARAM_DELETE_EXISTING - value: $(params.deleteExisting) - - name: PARAM_HTTP_PROXY - value: $(params.httpProxy) - - name: PARAM_HTTPS_PROXY - value: $(params.httpsProxy) - - name: PARAM_NO_PROXY - value: $(params.noProxy) - - name: PARAM_VERBOSE - value: $(params.verbose) - - name: PARAM_SPARSE_CHECKOUT_DIRECTORIES - value: $(params.sparseCheckoutDirectories) - - name: PARAM_USER_HOME - value: $(params.userHome) - - name: WORKSPACE_OUTPUT_PATH - value: $(workspaces.output.path) - - name: WORKSPACE_SSH_DIRECTORY_BOUND - value: $(workspaces.ssh-directory.bound) - - name: WORKSPACE_SSH_DIRECTORY_PATH - value: $(workspaces.ssh-directory.path) - - name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND - value: $(workspaces.basic-auth.bound) - - name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH - value: $(workspaces.basic-auth.path) - script: | - #!/usr/bin/env sh - set -eu - - if [ "${PARAM_VERBOSE}" = "true" ] ; then - set -x - fi - - if [ "${WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND}" = "true" ] ; then - cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" "${PARAM_USER_HOME}/.git-credentials" - cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.gitconfig" "${PARAM_USER_HOME}/.gitconfig" - chmod 400 "${PARAM_USER_HOME}/.git-credentials" - chmod 400 "${PARAM_USER_HOME}/.gitconfig" - fi - - if [ "${WORKSPACE_SSH_DIRECTORY_BOUND}" = "true" ] ; then - cp -R "${WORKSPACE_SSH_DIRECTORY_PATH}" "${PARAM_USER_HOME}"/.ssh - chmod 700 "${PARAM_USER_HOME}"/.ssh - chmod -R 400 "${PARAM_USER_HOME}"/.ssh/* - fi - - CHECKOUT_DIR="${WORKSPACE_OUTPUT_PATH}/${PARAM_SUBDIRECTORY}" - - cleandir() { - # Delete any existing contents of the repo directory if it exists. - # - # We don't just "rm -rf ${CHECKOUT_DIR}" because ${CHECKOUT_DIR} might be "/" - # or the root of a mounted volume. - if [ -d "${CHECKOUT_DIR}" ] ; then - # Delete non-hidden files and directories - rm -rf "${CHECKOUT_DIR:?}"/* - # Delete files and directories starting with . but excluding .. - rm -rf "${CHECKOUT_DIR}"/.[!.]* - # Delete files and directories starting with .. plus any other character - rm -rf "${CHECKOUT_DIR}"/..?* - fi - } - - if [ "${PARAM_DELETE_EXISTING}" = "true" ] ; then - cleandir - fi - - test -z "${PARAM_HTTP_PROXY}" || export HTTP_PROXY="${PARAM_HTTP_PROXY}" - test -z "${PARAM_HTTPS_PROXY}" || export HTTPS_PROXY="${PARAM_HTTPS_PROXY}" - test -z "${PARAM_NO_PROXY}" || export NO_PROXY="${PARAM_NO_PROXY}" - - /ko-app/git-init \ - -url="${PARAM_URL}" \ - -revision="${PARAM_REVISION}" \ - -refspec="${PARAM_REFSPEC}" \ - -path="${CHECKOUT_DIR}" \ - -sslVerify="${PARAM_SSL_VERIFY}" \ - -submodules="${PARAM_SUBMODULES}" \ - -depth="${PARAM_DEPTH}" \ - -sparseCheckoutDirectories="${PARAM_SPARSE_CHECKOUT_DIRECTORIES}" - cd "${CHECKOUT_DIR}" - RESULT_SHA="$(git rev-parse HEAD)" - EXIT_CODE="$?" - if [ "${EXIT_CODE}" != 0 ] ; then - exit "${EXIT_CODE}" - fi - printf "%s" "${RESULT_SHA}" > "$(results.commit.path)" - printf "%s" "${PARAM_URL}" > "$(results.url.path)" diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn-apply/kn-apply-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn-apply/kn-apply-1-6-0-task.yaml deleted file mode 100644 index 4d1ac26f32..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn-apply/kn-apply-1-6-0-task.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/kn-apply/0.1/kn-apply.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: kn-apply-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: Deployment - tekton.dev/tags: cli - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - This task deploys a given image to a Knative Service. - - It uses `kn service apply` to create or update given knative service. - params: - - name: KN_IMAGE - description: kn CLI container image to run this task - default: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:286f6b4c008307df1bc369891ef9e806050d3a5f5e77ee0c9313ffdb350abbcb - - name: SERVICE - description: Knative service name - - name: IMAGE - description: Image to deploy - steps: - - name: kn - image: "$(params.KN_IMAGE)" - command: ["/ko-app/kn"] - args: ["service", "apply", "$(params.SERVICE)", "--image", "$(params.IMAGE)"] - env: - - name: HOME - value: /tekton/home diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn-apply/kn-apply-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn-apply/kn-apply-task.yaml deleted file mode 100644 index a44e2ea7f1..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn-apply/kn-apply-task.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/kn-apply/0.1/kn-apply.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: kn-apply - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: Deployment - tekton.dev/tags: cli - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - This task deploys a given image to a Knative Service. - - It uses `kn service apply` to create or update given knative service. - params: - - name: KN_IMAGE - description: kn CLI container image to run this task - default: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:286f6b4c008307df1bc369891ef9e806050d3a5f5e77ee0c9313ffdb350abbcb - - name: SERVICE - description: Knative service name - - name: IMAGE - description: Image to deploy - steps: - - name: kn - image: "$(params.KN_IMAGE)" - command: ["/ko-app/kn"] - args: ["service", "apply", "$(params.SERVICE)", "--image", "$(params.IMAGE)"] - env: - - name: HOME - value: /tekton/home diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn/kn-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn/kn-1-6-0-task.yaml deleted file mode 100644 index 31a62efe9e..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn/kn-1-6-0-task.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/kn/0.1/kn.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: kn-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - This Task performs operations on Knative resources - (services, revisions, routes) using kn CLI - - params: - - name: kn-image - description: kn CLI container image to run this task - default: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:286f6b4c008307df1bc369891ef9e806050d3a5f5e77ee0c9313ffdb350abbcb - - name: ARGS - type: array - description: kn CLI arguments to run - default: - - "help" - steps: - - name: kn - image: "$(params.kn-image)" - command: ["/ko-app/kn"] - args: ["$(params.ARGS)"] diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn/kn-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn/kn-task.yaml deleted file mode 100644 index 998d8c0662..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/kn/kn-task.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/kn/0.1/kn.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: kn - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - This Task performs operations on Knative resources - (services, revisions, routes) using kn CLI - - params: - - name: kn-image - description: kn CLI container image to run this task - default: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:286f6b4c008307df1bc369891ef9e806050d3a5f5e77ee0c9313ffdb350abbcb - - name: ARGS - type: array - description: kn CLI arguments to run - default: - - "help" - steps: - - name: kn - image: "$(params.kn-image)" - command: ["/ko-app/kn"] - args: ["$(params.ARGS)"] diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/openshift-client/openshift-client-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/openshift-client/openshift-client-1-6-0-task.yaml deleted file mode 100644 index 7650addea3..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/openshift-client/openshift-client-1-6-0-task.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.24/task/openshift-client/0.2/openshift-client.yaml -# ---- ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: openshift-client-1-6-0 - labels: - app.kubernetes.io/version: "0.2" - annotations: - tekton.dev/pipelines.minVersion: "0.17.0" - tekton.dev/tags: cli - tekton.dev/displayName: "openshift client" -spec: - workspaces: - - name: manifest-dir - optional: true - description: >- - The workspace which contains kubernetes manifests which we want to apply on the cluster. - - name: kubeconfig-dir - optional: true - description: >- - The workspace which contains the the kubeconfig file if in case we want to run the oc command on another cluster. - description: >- - This task runs commands against the cluster provided by user - and if not provided then where the Task is being executed. - - OpenShift is a Kubernetes distribution from Red Hat which provides oc, - the OpenShift CLI that complements kubectl for simplifying deployment - and configuration applications on OpenShift. - - params: - - name: SCRIPT - description: The OpenShift CLI arguments to run - type: string - default: "oc help" - - name: VERSION - description: The OpenShift Version to use - type: string - default: "latest" - steps: - - name: oc - image: image-registry.openshift-image-registry.svc:5000/openshift/cli:$(params.VERSION) - script: | - #!/usr/bin/env bash - - [[ "$(workspaces.manifest-dir.bound)" == "true" ]] && \ - cd $(workspaces.manifest-dir.path) - - [[ "$(workspaces.kubeconfig-dir.bound)" == "true" ]] && \ - [[ -f $(workspaces.kubeconfig-dir.path)/kubeconfig ]] && \ - export KUBECONFIG=$(workspaces.kubeconfig-dir.path)/kubeconfig - - $(params.SCRIPT) diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-dotnet/s2i-dotnet-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-dotnet/s2i-dotnet-1-6-0-task.yaml deleted file mode 100644 index 07342dc2ce..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-dotnet/s2i-dotnet-1-6-0-task.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-dotnet/0.1/s2i-dotnet.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-dotnet-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, dotnet, workspace - tekton.dev/displayName: "s2i dotnet" -spec: - description: >- - s2i-dotnet task fetches a Git repository and builds and - pushes a container image using S2I and a .NET Core builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - - name: VERSION - description: The tag of .NET imagestream for .NET version - default: '3.1-ubi8' - 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 - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/dotnet:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen'] - volumeMounts: - - name: gen-source - mountPath: /gen-source - env: - - name: HOME - value: /tekton/home - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - workingDir: $(workspaces.source.path) - image: $(params.BUILDER_IMAGE) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-go/s2i-go-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-go/s2i-go-1-6-0-task.yaml deleted file mode 100644 index 5bb043ced5..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-go/s2i-go-1-6-0-task.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-go/0.1/s2i-go.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-go-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, go, workspace - tekton.dev/displayName: "s2i go" -spec: - description: >- - s2i-go task clones a Git repository and builds and - pushes a container image using S2I and a Go builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: VERSION - description: The tag of go imagestream for go version - default: '1.14.7-ubi8' - 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 - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/golang:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen'] - env: - - name: HOME - value: /tekton/home - volumeMounts: - - name: gen-source - mountPath: /gen-source - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - workingDir: $(workspaces.source.path) - image: $(params.BUILDER_IMAGE) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-java/s2i-java-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-java/s2i-java-1-6-0-task.yaml deleted file mode 100644 index 2363462ac0..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-java/s2i-java-1-6-0-task.yaml +++ /dev/null @@ -1,132 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-java/0.1/s2i-java.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-java-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, java, workspace - tekton.dev/displayName: "s2i java" -spec: - description: >- - s2i-java task clones a Git repository and builds and - pushes a container image using S2I and a Java builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: VERSION - description: The tag of java imagestream for java version - default: 'openjdk-11-ubi8' - 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 - - name: MAVEN_ARGS_APPEND - description: Additional Maven arguments - default: "" - type: string - - name: MAVEN_CLEAR_REPO - description: Remove the Maven repository after the artifact is built - default: "false" - type: string - - name: MAVEN_MIRROR_URL - description: The base URL of a mirror used for retrieving artifacts - default: "" - type: string - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: gen-env-file - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: /env-params - command: - - '/bin/sh' - - '-c' - args: - - |- - echo "MAVEN_CLEAR_REPO=$(params.MAVEN_CLEAR_REPO)" > env-file - - [[ '$(params.MAVEN_ARGS_APPEND)' != "" ]] && - echo "MAVEN_ARGS_APPEND=$(params.MAVEN_ARGS_APPEND)" >> env-file - - [[ '$(params.MAVEN_MIRROR_URL)' != "" ]] && - echo "MAVEN_MIRROR_URL=$(params.MAVEN_MIRROR_URL)" >> env-file - - echo "Generated Env file" - echo "------------------------------" - cat env-file - echo "------------------------------" - volumeMounts: - - name: envparams - mountPath: /env-params - env: - - name: HOME - value: /tekton/home - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - command: - - 's2i' - - 'build' - - '$(params.PATH_CONTEXT)' - - 'image-registry.openshift-image-registry.svc:5000/openshift/java:$(params.VERSION)' - - '--image-scripts-url' - - 'image:///usr/local/s2i' - - '--as-dockerfile' - - '/gen-source/Dockerfile.gen' - - '--environment-file' - - '/env-params/env-file' - volumeMounts: - - name: gen-source - mountPath: /gen-source - - name: envparams - mountPath: /env-params - env: - - name: HOME - value: /tekton/home - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - image: $(params.BUILDER_IMAGE) - workingDir: $(workspaces.source.path) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} - - name: envparams - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-nodejs/s2i-nodejs-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-nodejs/s2i-nodejs-1-6-0-task.yaml deleted file mode 100644 index 2a124ddb80..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-nodejs/s2i-nodejs-1-6-0-task.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-nodejs/0.1/s2i-nodejs.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-nodejs-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, nodejs, workspace - tekton.dev/displayName: "s2i nodejs" -spec: - description: >- - s2i-nodejs task clones a Git repository and builds and - pushes a container image using S2I and a nodejs builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: VERSION - description: The tag of nodejs imagestream for nodejs version - default: '14-ubi8' - 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 - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - 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 - env: - - name: HOME - value: /tekton/home - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - image: $(params.BUILDER_IMAGE) - workingDir: $(workspaces.source.path) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-perl/s2i-perl-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-perl/s2i-perl-1-6-0-task.yaml deleted file mode 100644 index 1092be7230..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-perl/s2i-perl-1-6-0-task.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-perl/0.1/s2i-perl.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-perl-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, perl, workspace - tekton.dev/displayName: "s2i perl" -spec: - description: >- - s2i-perl task clones a Git repository and builds and - pushes a container image using S2I and a Perl builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: VERSION - description: The tag of perl imagestream for perl version - default: '5.30-ubi8' - 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 - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/perl:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen'] - volumeMounts: - - name: gen-source - mountPath: /gen-source - env: - - name: HOME - value: /tekton/home - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - workingDir: $(workspaces.source.path) - image: $(params.BUILDER_IMAGE) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-php/s2i-php-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-php/s2i-php-1-6-0-task.yaml deleted file mode 100644 index 14408e6422..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-php/s2i-php-1-6-0-task.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-php/0.1/s2i-php.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-php-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, php, workspace - tekton.dev/displayName: "s2i php" -spec: - description: >- - s2i-php task clones a Git repository and builds and - pushes a container image using S2I and a PHP builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: VERSION - description: The tag of php imagestream for php version - default: '7.4-ubi8' - 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 - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/php:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen'] - volumeMounts: - - name: gen-source - mountPath: /gen-source - env: - - name: HOME - value: /tekton/home - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - image: $(params.BUILDER_IMAGE) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-python/s2i-python-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-python/s2i-python-1-6-0-task.yaml deleted file mode 100644 index d1f6faf884..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-python/s2i-python-1-6-0-task.yaml +++ /dev/null @@ -1,81 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-python/0.1/s2i-python.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-python-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, python, workspace - tekton.dev/displayName: "s2i python" -spec: - description: >- - s2i-python task clones a Git repository and builds and - pushes a container image using S2I and a Python builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: VERSION - description: The tag of python imagestream for python version - default: '3.8-ubi8' - 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 - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/python:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen'] - volumeMounts: - - name: gen-source - mountPath: /gen-source - env: - - name: HOME - value: /tekton/home - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - - workingDir: $(workspaces.source.path) - image: $(params.BUILDER_IMAGE) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-ruby/s2i-ruby-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-ruby/s2i-ruby-1-6-0-task.yaml deleted file mode 100644 index 1d10e4919b..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-ruby/s2i-ruby-1-6-0-task.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-ruby/0.1/s2i-ruby.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: s2i-ruby-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.19" - tekton.dev/tags: s2i, ruby, workspace - tekton.dev/displayName: "s2i ruby" -spec: - description: >- - s2i-ruby task clones a Git repository and builds and - pushes a container image using S2I and a Ruby builder image. - - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - params: - - name: VERSION - description: The tag of ruby imagestream for ruby version - default: '2.7-ubi8' - 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 - - name: IMAGE - description: Location of the repo where image has to be pushed - type: string - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - workspaces: - - name: source - mountPath: /workspace/source - steps: - - name: generate - image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631 - workingDir: $(workspaces.source.path) - command: ['s2i', 'build', '$(params.PATH_CONTEXT)', 'image-registry.openshift-image-registry.svc:5000/openshift/ruby:$(params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen'] - volumeMounts: - - name: gen-source - mountPath: /gen-source - env: - - name: HOME - value: /tekton/home - - name: build - image: $(params.BUILDER_IMAGE) - workingDir: /gen-source - command: ['buildah', 'bud', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--layers', '-f', '/gen-source/Dockerfile.gen', '-t', '$(params.IMAGE)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: gen-source - mountPath: /gen-source - - name: push - image: $(params.BUILDER_IMAGE) - workingDir: $(workspaces.source.path) - command: ['buildah', 'push', '--storage-driver=vfs', '--tls-verify=$(params.TLSVERIFY)', '--digestfile=$(workspaces.source.path)/image-digest', '$(params.IMAGE)', 'docker://$(params.IMAGE)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - - name: digest-to-results - image: $(params.BUILDER_IMAGE) - script: cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST - volumes: - - name: varlibcontainers - emptyDir: {} - - name: gen-source - emptyDir: {} diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/skopeo-copy/skopeo-copy-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/skopeo-copy/skopeo-copy-1-6-0-task.yaml deleted file mode 100644 index ad80e018a3..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/skopeo-copy/skopeo-copy-1-6-0-task.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/skopeo-copy/0.1/skopeo-copy.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: skopeo-copy-1-6-0 - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/displayName: "skopeo copy" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - Skopeo is a command line tool for working with remote image registries. - - Skopeo doesn’t require a daemon to be running while performing its operations. - In particular, the handy skopeo command called copy will ease the whole image - copy operation. The copy command will take care of copying the image from - internal.registry to production.registry. If your production registry requires - credentials to login in order to push the image, skopeo can handle that as well. - - workspaces: - - name: images-url - params: - - name: srcImageURL - description: URL of the image to be copied to the destination registry - type: string - default: "" - - name: destImageURL - description: URL of the image where the image from source should be copied to - type: string - default: "" - - name: srcTLSverify - description: Verify the TLS on the src registry endpoint - type: string - default: "true" - - name: destTLSverify - description: Verify the TLS on the dest registry endpoint - type: string - default: "true" - steps: - - name: skopeo-copy - image: registry.redhat.io/rhel8/skopeo@sha256:7297e3b42ef1d56a5bc1d64a979d05c157bf31b476cc526386c873a89459610a - script: | - # Function to copy multiple images. - # - copyimages() { - filename='$(workspaces.images-url.path)/url.txt' - while IFS= read line || [ -n "$line" ] - do - cmd="" - for url in $line - do - # echo $url - cmd="$cmd \ - $url" - done - skopeo copy $cmd --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify) - echo $cmd - done < "$filename" - } - # - # If single image is to be copied then, it can be passed through - # params in the taskrun. - if [ "$(params.srcImageURL)" != "" ] && [ "$(params.destImageURL)" != "" ] ; then - skopeo copy "$(params.srcImageURL)" "$(params.destImageURL)" --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify) - else - # If file is provided as a configmap in the workspace then multiple images can be copied. - # - copyimages - fi diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/skopeo-copy/skopeo-copy-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/skopeo-copy/skopeo-copy-task.yaml deleted file mode 100644 index 5c48afac35..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/skopeo-copy/skopeo-copy-task.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/skopeo-copy/0.1/skopeo-copy.yaml -# ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: skopeo-copy - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/displayName: "skopeo copy" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -spec: - description: >- - Skopeo is a command line tool for working with remote image registries. - - Skopeo doesn’t require a daemon to be running while performing its operations. - In particular, the handy skopeo command called copy will ease the whole image - copy operation. The copy command will take care of copying the image from - internal.registry to production.registry. If your production registry requires - credentials to login in order to push the image, skopeo can handle that as well. - - workspaces: - - name: images-url - params: - - name: srcImageURL - description: URL of the image to be copied to the destination registry - type: string - default: "" - - name: destImageURL - description: URL of the image where the image from source should be copied to - type: string - default: "" - - name: srcTLSverify - description: Verify the TLS on the src registry endpoint - type: string - default: "true" - - name: destTLSverify - description: Verify the TLS on the dest registry endpoint - type: string - default: "true" - steps: - - name: skopeo-copy - image: registry.redhat.io/rhel8/skopeo@sha256:7297e3b42ef1d56a5bc1d64a979d05c157bf31b476cc526386c873a89459610a - script: | - # Function to copy multiple images. - # - copyimages() { - filename='$(workspaces.images-url.path)/url.txt' - while IFS= read line || [ -n "$line" ] - do - cmd="" - for url in $line - do - # echo $url - cmd="$cmd \ - $url" - done - skopeo copy $cmd --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify) - echo $cmd - done < "$filename" - } - # - # If single image is to be copied then, it can be passed through - # params in the taskrun. - if [ "$(params.srcImageURL)" != "" ] && [ "$(params.destImageURL)" != "" ] ; then - skopeo copy "$(params.srcImageURL)" "$(params.destImageURL)" --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify) - else - # If file is provided as a configmap in the workspace then multiple images can be copied. - # - copyimages - fi diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/buildah/buildah-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/buildah/buildah-task.yaml similarity index 93% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/buildah/buildah-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/buildah/buildah-task.yaml index 67ab577e54..8cc6d568f1 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/buildah/buildah-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/buildah/buildah-task.yaml @@ -1,11 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.24/task/buildah/0.1/buildah.yaml -# ---- --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: buildah labels: diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/maven/maven-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/maven/maven-task.yaml similarity index 99% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/maven/maven-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/maven/maven-task.yaml index c7c2f3bd2d..51ac33ec72 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/maven/maven-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/maven/maven-task.yaml @@ -1,5 +1,6 @@ +--- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: maven labels: diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/openshift-client/openshift-client-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/openshift-client/openshift-client-task.yaml similarity index 96% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/openshift-client/openshift-client-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/openshift-client/openshift-client-task.yaml index 6c1fbb8080..7d7313ddf4 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/openshift-client/openshift-client-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/openshift-client/openshift-client-task.yaml @@ -1,11 +1,11 @@ -# auto generated by script/update-tasks.sh +# auto generated by script/fetch-tektoncd-catalog-tasks.sh # DO NOT EDIT: use the script instead # source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.24/task/openshift-client/0.2/openshift-client.yaml # --- --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: openshift-client labels: diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-dotnet/s2i-dotnet-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-dotnet/s2i-dotnet-task.yaml similarity index 92% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-dotnet/s2i-dotnet-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-dotnet/s2i-dotnet-task.yaml index 40b017519f..f805e7faa8 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-dotnet/s2i-dotnet-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-dotnet/s2i-dotnet-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-dotnet/0.1/s2i-dotnet.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-dotnet labels: @@ -27,7 +23,7 @@ spec: default: registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee - name: VERSION description: The tag of .NET imagestream for .NET version - default: '3.1-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from. diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-go/s2i-go-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-go/s2i-go-task.yaml similarity index 92% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-go/s2i-go-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-go/s2i-go-task.yaml index b19f994392..b5ad3eea7a 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-go/s2i-go-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-go/s2i-go-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-go/0.1/s2i-go.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-go labels: @@ -24,7 +20,7 @@ spec: params: - name: VERSION description: The tag of go imagestream for go version - default: '1.14.7-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from. diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-java/s2i-java-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-java/s2i-java-task.yaml similarity index 94% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-java/s2i-java-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-java/s2i-java-task.yaml index 344c2ae0ff..143ab1ea16 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-java/s2i-java-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-java/s2i-java-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-java/0.1/s2i-java.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-java labels: @@ -24,7 +20,7 @@ spec: params: - name: VERSION description: The tag of java imagestream for java version - default: 'openjdk-11-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-nodejs/s2i-nodejs-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-nodejs/s2i-nodejs-task.yaml similarity index 92% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-nodejs/s2i-nodejs-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-nodejs/s2i-nodejs-task.yaml index 355a259dfd..2aa8f22d4d 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-nodejs/s2i-nodejs-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-nodejs/s2i-nodejs-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-nodejs/0.1/s2i-nodejs.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-nodejs labels: @@ -24,7 +20,7 @@ spec: params: - name: VERSION description: The tag of nodejs imagestream for nodejs version - default: '14-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from. diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-perl/s2i-perl-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-perl/s2i-perl-task.yaml similarity index 92% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-perl/s2i-perl-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-perl/s2i-perl-task.yaml index 03ec76214b..8d9e018759 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-perl/s2i-perl-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-perl/s2i-perl-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-perl/0.1/s2i-perl.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-perl labels: @@ -24,7 +20,7 @@ spec: params: - name: VERSION description: The tag of perl imagestream for perl version - default: '5.30-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from. diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-php/s2i-php-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-php/s2i-php-task.yaml similarity index 92% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-php/s2i-php-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-php/s2i-php-task.yaml index 3bca4d67b8..dbfc35fcd7 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-php/s2i-php-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-php/s2i-php-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-php/0.1/s2i-php.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-php labels: @@ -24,7 +20,7 @@ spec: params: - name: VERSION description: The tag of php imagestream for php version - default: '7.4-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from. diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-python/s2i-python-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-python/s2i-python-task.yaml similarity index 92% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-python/s2i-python-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-python/s2i-python-task.yaml index 069ec63506..938b2eb32b 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-python/s2i-python-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-python/s2i-python-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-python/0.1/s2i-python.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-python labels: @@ -24,7 +20,7 @@ spec: params: - name: VERSION description: The tag of python imagestream for python version - default: '3.8-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from. diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-ruby/s2i-ruby-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-ruby/s2i-ruby-task.yaml similarity index 92% rename from cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-ruby/s2i-ruby-task.yaml rename to cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-ruby/s2i-ruby-task.yaml index b41baf9535..fd12da2055 100644 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/s2i-ruby/s2i-ruby-task.yaml +++ b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_local/s2i-ruby/s2i-ruby-task.yaml @@ -1,10 +1,6 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/pipelines-catalog/release-v0.28/task/s2i-ruby/0.1/s2i-ruby.yaml -# --- apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: s2i-ruby labels: @@ -24,7 +20,7 @@ spec: params: - name: VERSION description: The tag of ruby imagestream for ruby version - default: '2.7-ubi8' + default: 'latest' type: string - name: PATH_CONTEXT description: The location of the path to run s2i from. diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/tkn/tkn-1-6-0-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/tkn/tkn-1-6-0-task.yaml deleted file mode 100644 index d6d1906a09..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/tkn/tkn-1-6-0-task.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/tkn/0.2/tkn.yaml -# ---- ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: tkn-1-6-0 - labels: - app.kubernetes.io/version: "0.2" - annotations: - tekton.dev/pipelines.minVersion: "0.17.0" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/displayName: "Tekton CLI" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le" -spec: - workspaces: - - name: kubeconfig - description: >- - An optional workspace that allows you to provide a .kube/config - file for tkn to access the cluster. The file should be placed at - the root of the Workspace with name kubeconfig. - optional: true - description: >- - This task performs operations on Tekton resources using tkn - - params: - - name: TKN_IMAGE - description: tkn CLI container image to run this task - default: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677 - - name: SCRIPT - description: tkn CLI script to execute - type: string - default: "tkn $@" - - name: ARGS - type: array - description: tkn CLI arguments to run - default: ["--help"] - steps: - - name: tkn - image: "$(params.TKN_IMAGE)" - script: | - if [ "$(workspaces.kubeconfig.bound)" == "true" ] && [[ -e $(workspaces.kubeconfig.path)/kubeconfig ]]; then - export KUBECONFIG=$(workspaces.kubeconfig.path)/kubeconfig - fi - - $(params.SCRIPT) - args: ["$(params.ARGS)"] diff --git a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/tkn/tkn-task.yaml b/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/tkn/tkn-task.yaml deleted file mode 100644 index ebae9826f3..0000000000 --- a/cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/tkn/tkn-task.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.28/task/tkn/0.2/tkn.yaml -# ---- ---- -apiVersion: tekton.dev/v1beta1 -kind: ClusterTask -metadata: - name: tkn - labels: - app.kubernetes.io/version: "0.2" - annotations: - tekton.dev/pipelines.minVersion: "0.17.0" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/displayName: "Tekton CLI" - tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le" -spec: - workspaces: - - name: kubeconfig - description: >- - An optional workspace that allows you to provide a .kube/config - file for tkn to access the cluster. The file should be placed at - the root of the Workspace with name kubeconfig. - optional: true - description: >- - This task performs operations on Tekton resources using tkn - - params: - - name: TKN_IMAGE - description: tkn CLI container image to run this task - default: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677 - - name: SCRIPT - description: tkn CLI script to execute - type: string - default: "tkn $@" - - name: ARGS - type: array - description: tkn CLI arguments to run - default: ["--help"] - steps: - - name: tkn - image: "$(params.TKN_IMAGE)" - script: | - if [ "$(workspaces.kubeconfig.bound)" == "true" ] && [[ -e $(workspaces.kubeconfig.path)/kubeconfig ]]; then - export KUBECONFIG=$(workspaces.kubeconfig.path)/kubeconfig - fi - - $(params.SCRIPT) - args: ["$(params.ARGS)"] diff --git a/config/openshift/base/kustomization.yaml b/config/openshift/base/kustomization.yaml index 9469ef8f3f..0cc333b0a7 100644 --- a/config/openshift/base/kustomization.yaml +++ b/config/openshift/base/kustomization.yaml @@ -53,4 +53,4 @@ configMapGenerator: - name: tekton-config-defaults literals: - DEFAULT_TARGET_NAMESPACE=openshift-pipelines - behavior: merge \ No newline at end of file + behavior: merge diff --git a/config/openshift/base/operator.yaml b/config/openshift/base/operator.yaml index 1b9d274028..8964fbc9e2 100644 --- a/config/openshift/base/operator.yaml +++ b/config/openshift/base/operator.yaml @@ -66,6 +66,14 @@ spec: value: tekton-config-observability - name: IMAGE_HUB_TEKTON_HUB_DB value: registry.redhat.io/rhel8/postgresql-13@sha256:6032adb3eac903ee8aa61f296ca9aaa57f5709e5673504b609222e042823f195 + - name: IMAGE_ADDONS_PARAM_BUILDER_IMAGE + value: registry.redhat.io/rhel8/buildah@sha256:31f84b19a0774be7cfad751be38fc97f5e86cefd26e0abaec8047ddc650b00bf + - name: IMAGE_ADDONS_PARAM_KN_IMAGE + value: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:b8b992e36f76d80b1daeed0532adf94b1ce570a6aaef1dbcc2a28c666f8cd296 + - name: IMAGE_ADDONS_SKOPEO_COPY + value: registry.redhat.io/rhel8/skopeo@sha256:a458abaee565344e8c31468bb5bec26bdc622c559678ab73b07ee4998de68bd0 + - name: IMAGE_ADDONS_GENERATE + value: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:98d8cb3a255641ca6a1bce854e5e2460c20de9fb9b28e3cc67eb459f122873dd # - name: IMAGE_ADDONS_TKN_CLI_SERVE # value: docker.io/rupali/serve-tkn:v2 # - name: IMAGE_ADDONS_PARAM_TKN_IMAGE diff --git a/hack/fetch-releases.sh b/hack/fetch-releases.sh index a0b6190837..f79b50bb10 100755 --- a/hack/fetch-releases.sh +++ b/hack/fetch-releases.sh @@ -155,6 +155,12 @@ release_yaml_hub() { done } +fetch_openshift_addon_tasks() { + fetch_addon_task_script="${SCRIPT_DIR}/hack/openshift" + local dest_dir="cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_external" + ${fetch_addon_task_script}/fetch-tektoncd-catalog-tasks.sh ${dest_dir} +} + #Args: main() { TARGET=$1 @@ -184,6 +190,7 @@ main() { else pac_version=${6} release_yaml_pac pipelinesascode release ${pac_version} + fetch_openshift_addon_tasks fi hub_version=${7} diff --git a/hack/openshift/fetch-tektoncd-catalog-tasks.sh b/hack/openshift/fetch-tektoncd-catalog-tasks.sh new file mode 100755 index 0000000000..7b6dc048e7 --- /dev/null +++ b/hack/openshift/fetch-tektoncd-catalog-tasks.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +set -e -u -o pipefail + +declare -r SCRIPT_NAME=$(basename "$0") +declare -r SCRIPT_DIR=$(cd $(dirname "$0") && pwd) + +log() { + local level=$1; shift + echo -e "$level: $@" +} + + +err() { + log "ERROR" "$@" >&2 +} + +info() { + log "INFO" "$@" +} + +die() { + local code=$1; shift + local msg="$@"; shift + err $msg + exit $code +} + +usage() { + local msg="$1" + cat <<-EOF +Error: $msg + +USAGE: + $SCRIPT_NAME DEST_DIR + +Example: + $SCRIPT_NAME cmd/openshift/operator/kodata/tekton-addon/addons/02-clustertasks/source_external +EOF + exit 1 +} + +#declare -r CATALOG_VERSION="release-v0.7" + +declare -r TEKTON_CATALOG="https://raw.githubusercontent.com/tektoncd/catalog" +declare -A TEKTON_CATALOG_TASKS=( + # Need to remove version param + ["git-clone"]="0.4" + ["kn"]="0.1" + ["kn-apply"]="0.1" + ["skopeo-copy"]="0.1" + ["tkn"]="0.2" + # Those tasks are managed directly in the repository + # ["buildah"]="0.1" + # ["openshift-client"]="0.2" +) + +download_task() { + local task_path="$1"; shift + local task_url="$1"; shift + + info "downloading ... $t from $task_url" + # validate url + curl --output /dev/null --silent --head --fail "$task_url" || return 1 + + + cat <<-EOF > "$task_path" +# auto generated by script/update-tasks.sh +# DO NOT EDIT: use the script instead +# source: $task_url +# +--- +$(curl -sLf "$task_url") +EOF + + # NOTE: helps when the original and the generated need to compared + # curl -sLf "$task_url" -o "$task_path.orig" + +} + + +get_tasks() { + local dest_dir="$1"; shift + local catalog="$1"; shift + local catalog_version="$1"; shift + local -n tasks=$1 + + info "Downloading tasks from catalog $catalog to $dest_dir directory" + for t in ${!tasks[@]} ; do + # task filenames do not follow a naming convention, + # some are taskname.yaml while others are taskname-task.yaml + # so, try both before failing + local task_url="$catalog/$catalog_version/task/$t/${tasks[$t]}/${t}.yaml" + echo "$catalog/$catalog_version/task/$t/${tasks[$t]}/${t}.yaml" + + mkdir -p "$dest_dir/$t/" + local task_path="$dest_dir/$t/$t-task.yaml" + + download_task "$task_path" "$task_url" || + die 1 "Failed to download $t" + done +} + +create_dir_or_die() { + local dest_dir="$1"; shift + mkdir -p "$dest_dir" || die 1 "failed to create ${dest_dir}" + echo $dest_dir created +} + +main() { + + local dest_dir=${1:-''} + [[ -z "$dest_dir" ]] && usage "missing destination directory" + shift + + [[ ! -d "$dest_dir" ]] && create_dir_or_die "$dest_dir" || echo "$dest_dir" exists + + get_tasks "$dest_dir" "$TEKTON_CATALOG" "main" TEKTON_CATALOG_TASKS + + return $? +} + +main "$@" diff --git a/hack/openshift/update-image-sha.sh b/hack/openshift/update-image-sha.sh new file mode 100755 index 0000000000..b10289bc9c --- /dev/null +++ b/hack/openshift/update-image-sha.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +set -e -u -o pipefail + +declare -r SCRIPT_NAME=$(basename "$0") +declare -r SCRIPT_DIR=$(cd $(dirname "$0") && pwd) +declare -r USERNAME=${REGISTRY_USER} +declare -r PASSWORD=${REGISTRY_PASSWORD} + +log() { + local level=$1; shift + echo -e "$level: $@" +} + + +err() { + log "ERROR" "$@" >&2 +} + +info() { + log "INFO" "$@" +} + +die() { + local code=$1; shift + local msg="$@"; shift + err $msg + exit $code +} + +usage() { + local msg="$1" + cat <<-EOF +Error: $msg + +USAGE: + REGISTRY_USER= REGISTRY_PASSWORD= $SCRIPT_NAME + +Example: + REGISTRY_USER=johnsmith REGISTRY_PASSWORD=pass123 $SCRIPT_NAME +EOF + exit 1 +} + +#declare -r CATALOG_VERSION="release-v0.7" + +declare -A IMAGES=( + ["buildah"]="registry.redhat.io/rhel8/buildah" + ["kn"]="registry.redhat.io/openshift-serverless-1/client-kn-rhel8" + ["skopeo-copy"]="registry.redhat.io/rhel8/skopeo" + ["s2i"]="registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8" +) + +find_latest_versions() { + local image_registry=${1:-""} + local latest_version="" + podman search --list-tags ${image_registry} | grep -v NAME | tr -s ' ' | cut -d ' ' -f 2 | sort -r | grep -v '\-[a-z0-9\.]*$' | head -n 1 +} + +find_sha_from_tag() { + local image_url=${1:-""} + podman run docker.io/mplatform/manifest-tool:v2.0.0 --username=${USERNAME} --password=${PASSWORD} inspect $image_url --raw | jq '.digest' | tr -d '"' +} + +update_image_sha() { + local image_prefix=${1:-""} + shift + local image_sha=${1:-""} + shift + echo replacemnet var = ${image_prefix} + sed -i -E 's%('${image_prefix}').*%\1@'${image_sha}'%' config/openshift/base/operator.yaml + sed -i -E 's%('${image_prefix}').*%\1@'${image_sha}'%' operatorhub/openshift/config.yaml +} + + +main() { + + for image in ${!IMAGES[@]}; do + latest_version=$(find_latest_versions ${IMAGES[$image]}) + echo latest_version=$latest_version + image_url="${IMAGES[$image]}":"${latest_version}" + echo $image_url + image_sha=$(find_sha_from_tag "${image_url}") + echo image_sha=${image_sha} + update_image_sha "${IMAGES[$image]}" $image_sha + + done + + return $? +} + +main "$@" diff --git a/hack/openshift/update-tasks.sh b/hack/openshift/update-tasks.sh deleted file mode 100755 index ac2131e33b..0000000000 --- a/hack/openshift/update-tasks.sh +++ /dev/null @@ -1,221 +0,0 @@ -#!/usr/bin/env bash -set -e -u -o pipefail - -declare -r SCRIPT_NAME=$(basename "$0") -declare -r SCRIPT_DIR=$(cd $(dirname "$0") && pwd) - -log() { - local level=$1; shift - echo -e "$level: $@" -} - - -err() { - log "ERROR" "$@" >&2 -} - -info() { - log "INFO" "$@" -} - -die() { - local code=$1; shift - local msg="$@"; shift - err $msg - exit $code -} - -usage() { - local msg="$1" - cat <<-EOF -Error: $msg - -USAGE: - $SCRIPT_NAME CATALOG_VERSION DEST_DIR VERSION - -Example: - $SCRIPT_NAME release-v0.24 cmd/openshift/operator/kodata/tekton-addon/1.5.0 1.5.0 -EOF - exit 1 -} - -#declare -r CATALOG_VERSION="release-v0.7" - -declare -r TEKTON_CATALOG="https://raw.githubusercontent.com/openshift/tektoncd-catalog" -declare -A TEKTON_CATALOG_TASKS=( - # Need to remove version param - ["git-clone"]="0.4" - ["kn"]="0.1" - ["kn-apply"]="0.1" - ["skopeo-copy"]="0.1" - ["tkn"]="0.2" - # Those tasks are managed directly in the repository - # ["buildah"]="0.1" - # ["openshift-client"]="0.2" -) - -declare -r OPENSHIFT_CATALOG="https://raw.githubusercontent.com/openshift/pipelines-catalog" -declare -A OPENSHIFT_CATALOG_TASKS=( - ["s2i-go"]="0.1" - ["s2i-java"]="0.1" - ["s2i-python"]="0.1" - ["s2i-nodejs"]="0.1" - ["s2i-perl"]="0.1" - ["s2i-php"]="0.1" - ["s2i-ruby"]="0.1" - ["s2i-dotnet"]="0.1" -) - - -download_task() { - local task_path="$1"; shift - local task_url="$1"; shift - - info "downloading ... $t from $task_url" - # validate url - curl --output /dev/null --silent --head --fail "$task_url" || return 1 - - - cat <<-EOF > "$task_path" -# auto generated by script/update-tasks.sh -# DO NOT EDIT: use the script instead -# source: $task_url -# ---- -$(curl -sLf "$task_url" | - sed -e 's|^kind: Task|kind: ClusterTask|g' \ - -e "s|^\(\s\+\)workingdir:\(.*\)|\1workingDir:\2|g" ) -EOF - - # NOTE: helps when the original and the generated need to compared - # curl -sLf "$task_url" -o "$task_path.orig" - -} - -change_task_image() { - local dest_dir="$1"; shift - local version="${1//./-}"; shift - - local task="$1"; shift - local task_path="$dest_dir/${task}/${task}-task.yaml" - local task_path_version="$dest_dir/${task}/${task}-$version-task.yaml" - - local expr=$1; shift - local image=$1; shift - - sed \ - -i "s'$expr.*'$image'" \ - $task_path - - sed \ - -i "s'$expr.*'$image'" \ - $task_path_version -} - -get_tasks() { - local dest_dir="$1"; shift - local version="${1//./-}"; shift - - local catalog="$1"; shift - local catalog_version="$1"; shift - - local -n tasks=$1 - - - info "Downloading tasks from catalog $catalog to $dest_dir directory" - for t in ${!tasks[@]} ; do - # task filenames do not follow a naming convention, - # some are taskname.yaml while others are taskname-task.yaml - # so, try both before failing - local task_url="$catalog/$catalog_version/task/$t/${tasks[$t]}/${t}.yaml" - echo "$catalog/$catalog_version/task/$t/${tasks[$t]}/${t}.yaml" - mkdir -p "$dest_dir/$t/" - local task_path="$dest_dir/$t/$t-task.yaml" - - download_task "$task_path" "$task_url" || - die 1 "Failed to download $t" - - create_version "$task_path" "$t" "$version" || - die 1 "failed to convert $t to $t-$version" - done -} - - -create_version() { - local task_path="$1"; shift - local task="$1"; shift - local version="$1"; shift - local task_version_path="$(dirname $task_path)/$task-$version-task.yaml" - - sed \ - -e "s|^\(\s\+name:\)\s\+\($task\)|\1 \2-$version|g" \ - $task_path > "$task_version_path" -} - - - -main() { - - - local catalog_version=${1:-''} - [[ -z "$catalog_version" ]] && usage "missing catalog_version" - shift - - local dest_dir=${1:-''} - [[ -z "$dest_dir" ]] && usage "missing destination directory" - shift - - local version=${1:-''} - [[ -z "$version" ]] && usage "missing task_version" - shift - - mkdir -p "$dest_dir" || die 1 "failed to create ${dest_dir}" - - dest_dir="$dest_dir/addons/02-clustertasks" - mkdir -p "$dest_dir" || die 1 "failed to create catalog dir ${catalog_dir}" - - get_tasks "$dest_dir" "$version" \ - "$TEKTON_CATALOG" "$catalog_version" TEKTON_CATALOG_TASKS - - get_tasks "$dest_dir" "$version" \ - "$OPENSHIFT_CATALOG" "$catalog_version" OPENSHIFT_CATALOG_TASKS - - # ./manifest-tool inspect registry.redhat.io/rhel8/buildah:latest - change_task_image "$dest_dir" "$version" \ - "buildah" "quay.io/buildah" \ - "registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee" - -# change_task_image "$dest_dir" "$version" \ -# "openshift-client" 'quay.io/openshift/origin-cli:$(params.VERSION)' \ -# 'image-registry.openshift-image-registry.svc:5000/openshift/cli:$(params.VERSION)' - - # ./manifest-tool inspect registry.redhat.io/openshift-serverless-1/client-kn-rhel8:0.22 - change_task_image "$dest_dir" "$version" \ - "kn" "gcr.io/knative-releases/knative.dev/client/cmd/kn:latest" \ - "registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:286f6b4c008307df1bc369891ef9e806050d3a5f5e77ee0c9313ffdb350abbcb" - - change_task_image "$dest_dir" "$version" \ - "kn-apply" "gcr.io/knative-releases/knative.dev/client/cmd/kn:latest" \ - "registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:286f6b4c008307df1bc369891ef9e806050d3a5f5e77ee0c9313ffdb350abbcb" - - # ./manifest-tool inspect registry.redhat.io/rhel8/skopeo:latest - change_task_image "$dest_dir" "$version" \ - "skopeo-copy" "quay.io/skopeo/stable" \ - "registry.redhat.io/rhel8/skopeo@sha256:7297e3b42ef1d56a5bc1d64a979d05c157bf31b476cc526386c873a89459610a" - - for t in ${!OPENSHIFT_CATALOG_TASKS[@]} ; do - # ./manifest-tool inspect registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8:v1.3.1 - change_task_image "$dest_dir" "$version" \ - "$t" "quay.io/openshift-pipeline/s2i" \ - "registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:637c15600359cb45bc01445b5e811b6240ca239f0ebfe406b50146e34f68f631" - - change_task_image "$dest_dir" "$version" \ - "$t" "quay.io/buildah" \ - "registry.redhat.io/rhel8/buildah@sha256:99cae35f40c7ec050fed3765b2b27e0b8bbea2aa2da7c16408e2ca13c60ff8ee" - - done - - return $? -} - -main "$@" diff --git a/operatorhub/openshift/config.yaml b/operatorhub/openshift/config.yaml index 3844cf6248..0e931489c5 100644 --- a/operatorhub/openshift/config.yaml +++ b/operatorhub/openshift/config.yaml @@ -105,21 +105,21 @@ image-substitutions: containerName: openshift-pipelines-operator envKeys: - IMAGE_TRIGGERS_ARG__EL_IMAGE -- image: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:ff72dbda3b8debe357562b1b2fd205a2f147794b705724e3e0177242c8c46e4b +- image: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:b8b992e36f76d80b1daeed0532adf94b1ce570a6aaef1dbcc2a28c666f8cd296 replaceLocations: envTargets: - deploymentName: openshift-pipelines-operator containerName: openshift-pipelines-operator envKeys: - IMAGE_ADDONS_PARAM_KN_IMAGE -- image: registry.redhat.io/rhel8/skopeo@sha256:e3bfa388349af51ca9c9315cf5b1cefa91c5984aa32904b63cf361b6b30ff09b +- image: registry.redhat.io/rhel8/skopeo@sha256:a458abaee565344e8c31468bb5bec26bdc622c559678ab73b07ee4998de68bd0 replaceLocations: envTargets: - deploymentName: openshift-pipelines-operator containerName: openshift-pipelines-operator envKeys: - IMAGE_ADDONS_SKOPEO_COPY -- image: registry.redhat.io/rhel8/buildah@sha256:54a91c55d055b641b9fea7f1ddb60463d50b75f1a6f7169090fadac3fb199ddd +- image: registry.redhat.io/rhel8/buildah@sha256:31f84b19a0774be7cfad751be38fc97f5e86cefd26e0abaec8047ddc650b00bf replaceLocations: envTargets: - deploymentName: openshift-pipelines-operator @@ -191,6 +191,14 @@ image-substitutions: # add thrid party images which are not replaced by operator # but pulled directly by tasks here -defaultRelatedImages: [] +defaultRelatedImages: +- image: registry.redhat.io/rhel8/buildah@sha256:31f84b19a0774be7cfad751be38fc97f5e86cefd26e0abaec8047ddc650b00bf + name: IMAGE_ADDONS_PARAM_BUILDER_IMAGE +- image: registry.redhat.io/openshift-serverless-1/client-kn-rhel8@sha256:b8b992e36f76d80b1daeed0532adf94b1ce570a6aaef1dbcc2a28c666f8cd296 + name: IMAGE_ADDONS_PARAM_KN_IMAGE +- image: registry.redhat.io/rhel8/skopeo@sha256:a458abaee565344e8c31468bb5bec26bdc622c559678ab73b07ee4998de68bd0 + name: IMAGE_ADDONS_SKOPEO_COPY +- image: registry.redhat.io/ocp-tools-4-tech-preview/source-to-image-rhel8@sha256:98d8cb3a255641ca6a1bce854e5e2460c20de9fb9b28e3cc67eb459f122873dd + name: IMAGE_ADDONS_GENERATE #- image: "" ##: or @ # name: "" # ENV key name value diff --git a/pkg/reconciler/common/testdata/test-replace-addon-image.yaml b/pkg/reconciler/common/testdata/test-replace-addon-image.yaml index f82ccd826a..c4ac5b82d8 100644 --- a/pkg/reconciler/common/testdata/test-replace-addon-image.yaml +++ b/pkg/reconciler/common/testdata/test-replace-addon-image.yaml @@ -1,4 +1,4 @@ -# auto generated by script/update-tasks.sh +# auto generated by hack/openshift/fetch-tektoncd-catalog-tasks.sh # DO NOT EDIT: use the script instead # source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.10/buildah/buildah.yaml # diff --git a/pkg/reconciler/openshift/tektonaddon/clustertTask.go b/pkg/reconciler/openshift/tektonaddon/clustertTask.go index 784cebbaf8..6604e52c69 100644 --- a/pkg/reconciler/openshift/tektonaddon/clustertTask.go +++ b/pkg/reconciler/openshift/tektonaddon/clustertTask.go @@ -23,7 +23,6 @@ import ( "github.com/tektoncd/operator/pkg/apis/operator/v1alpha1" "github.com/tektoncd/operator/pkg/reconciler/common" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "strings" ) @@ -33,13 +32,6 @@ var clusterTaskLS = metav1.LabelSelector{ }, } -// byContains returns resources with specific string in name -func byContains(name string) mf.Predicate { - return func(u *unstructured.Unstructured) bool { - return strings.Contains(u.GetName(), name) - } -} - func (r *Reconciler) EnsureClusterTask(ctx context.Context, enable string, ta *v1alpha1.TektonAddon) error { clusterTaskLabelSelector, err := common.LabelSelector(clusterTaskLS) @@ -83,14 +75,13 @@ func (r *Reconciler) ensureClusterTasks(ctx context.Context, ta *v1alpha1.Tekton return err } // Run transformers - if err := r.addonTransform(ctx, &clusterTaskManifest, ta); err != nil { + tfs := []mf.Transformer{ + replaceKind(KindTask, KindClusterTask), + } + if err := r.addonTransform(ctx, &clusterTaskManifest, ta, tfs...); err != nil { return err } - clusterTaskManifest = clusterTaskManifest.Filter( - mf.Not(byContains(getFormattedVersion(r.operatorVersion))), - ) - if err := createInstallerSet(ctx, r.operatorClientSet, ta, clusterTaskManifest, r.operatorVersion, ClusterTaskInstallerSet, "addon-clustertasks"); err != nil { return err diff --git a/pkg/reconciler/openshift/tektonaddon/clustertTaskVersioned.go b/pkg/reconciler/openshift/tektonaddon/clustertTaskVersioned.go index 86dbd4d094..c1ed111396 100644 --- a/pkg/reconciler/openshift/tektonaddon/clustertTaskVersioned.go +++ b/pkg/reconciler/openshift/tektonaddon/clustertTaskVersioned.go @@ -88,14 +88,14 @@ func (r *Reconciler) ensureVersionedClusterTasks(ctx context.Context, ta *v1alph return err } // Run transformers - if err := r.addonTransform(ctx, &clusterTaskManifest, ta); err != nil { + tfs := []mf.Transformer{ + replaceKind(KindTask, KindClusterTask), + setVersionedNames(r.operatorVersion), + } + if err := r.addonTransform(ctx, &clusterTaskManifest, ta, tfs...); err != nil { return err } - clusterTaskManifest = clusterTaskManifest.Filter( - byContains(getFormattedVersion(r.operatorVersion)), - ) - if err := createInstallerSet(ctx, r.operatorClientSet, ta, clusterTaskManifest, r.operatorVersion, VersionedClusterTaskInstallerSet, "addon-versioned-clustertasks"); err != nil { return err diff --git a/pkg/reconciler/openshift/tektonaddon/const.go b/pkg/reconciler/openshift/tektonaddon/const.go index c319715ecf..fdd35f94c0 100644 --- a/pkg/reconciler/openshift/tektonaddon/const.go +++ b/pkg/reconciler/openshift/tektonaddon/const.go @@ -26,4 +26,6 @@ const ( MiscellaneousResourcesInstallerSet = "MiscellaneousResources" PACInstallerSet = "PipelinesAsCode" CreatedByValue = "TektonAddon" + KindTask = "Task" + KindClusterTask = "ClusterTask" ) diff --git a/pkg/reconciler/openshift/tektonaddon/tektonaddon.go b/pkg/reconciler/openshift/tektonaddon/tektonaddon.go index f9f19bbce1..4b0491d135 100644 --- a/pkg/reconciler/openshift/tektonaddon/tektonaddon.go +++ b/pkg/reconciler/openshift/tektonaddon/tektonaddon.go @@ -216,13 +216,14 @@ func applyAddons(manifest *mf.Manifest, subpath string) error { // addonTransform mutates the passed manifest to one with common, component // and platform transformations applied -func (r *Reconciler) addonTransform(ctx context.Context, manifest *mf.Manifest, comp v1alpha1.TektonComponent) error { +func (r *Reconciler) addonTransform(ctx context.Context, manifest *mf.Manifest, comp v1alpha1.TektonComponent, addnTfs ...mf.Transformer) error { instance := comp.(*v1alpha1.TektonAddon) - extra := []mf.Transformer{ + addonTfs := []mf.Transformer{ injectLabel(labelProviderType, providerTypeRedHat, overwrite, "ClusterTask"), } - extra = append(extra, r.extension.Transformers(instance)...) - return common.Transform(ctx, manifest, instance, extra...) + addonTfs = append(addonTfs, addnTfs...) + addonTfs = append(addonTfs, r.extension.Transformers(instance)...) + return common.Transform(ctx, manifest, instance, addonTfs...) } func findValue(params []v1alpha1.Param, name string) (string, bool) { diff --git a/pkg/reconciler/openshift/tektonaddon/testdata/test-versioned-clustertask-name-expected.yaml b/pkg/reconciler/openshift/tektonaddon/testdata/test-versioned-clustertask-name-expected.yaml new file mode 100644 index 0000000000..0d621c9f72 --- /dev/null +++ b/pkg/reconciler/openshift/tektonaddon/testdata/test-versioned-clustertask-name-expected.yaml @@ -0,0 +1,46 @@ +# auto generated by hack/openshift/fetch-tektoncd-catalog-tasks.sh +# DO NOT EDIT: use the script instead +# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.10/buildah/buildah.yaml +# +--- +--- +apiVersion: tekton.dev/v1beta1 +kind: ClusterTask +metadata: + name: buildah-1-7 +spec: + params: + - name: BUILDER_IMAGE + description: The location of the buildah builder image. + default: quay.io/buildah/stable:v1.11.0 + - name: DOCKERFILE + description: Path to the Dockerfile to build. + default: ./Dockerfile + - name: TLSVERIFY + description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) + default: "true" + + steps: + - name: build + image: $(inputs.params.BUILDER_IMAGE) + workingDir: /workspace/source + command: ['buildah', 'bud', '--tls-verify=$(inputs.params.TLSVERIFY)', '--layers', '-f', '$(inputs.params.DOCKERFILE)', '-t', '$(outputs.resources.image.url)', '.'] + volumeMounts: + - name: varlibcontainers + mountPath: /var/lib/containers + securityContext: + privileged: true + + - name: push-image + image: buildah + workingDir: /workspace/source + command: ['buildah', 'push', '--tls-verify=$(inputs.params.TLSVERIFY)', '$(outputs.resources.image.url)', 'docker://$(outputs.resources.image.url)'] + volumeMounts: + - name: varlibcontainers + mountPath: /var/lib/containers + securityContext: + privileged: true + + volumes: + - name: varlibcontainers + emptyDir: {} \ No newline at end of file diff --git a/pkg/reconciler/openshift/tektonaddon/testdata/test-versioned-clustertask-name.yaml b/pkg/reconciler/openshift/tektonaddon/testdata/test-versioned-clustertask-name.yaml new file mode 100644 index 0000000000..c4ac5b82d8 --- /dev/null +++ b/pkg/reconciler/openshift/tektonaddon/testdata/test-versioned-clustertask-name.yaml @@ -0,0 +1,46 @@ +# auto generated by hack/openshift/fetch-tektoncd-catalog-tasks.sh +# DO NOT EDIT: use the script instead +# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.10/buildah/buildah.yaml +# +--- +--- +apiVersion: tekton.dev/v1beta1 +kind: ClusterTask +metadata: + name: buildah +spec: + params: + - name: BUILDER_IMAGE + description: The location of the buildah builder image. + default: quay.io/buildah/stable:v1.11.0 + - name: DOCKERFILE + description: Path to the Dockerfile to build. + default: ./Dockerfile + - name: TLSVERIFY + description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) + default: "true" + + steps: + - name: build + image: $(inputs.params.BUILDER_IMAGE) + workingDir: /workspace/source + command: ['buildah', 'bud', '--tls-verify=$(inputs.params.TLSVERIFY)', '--layers', '-f', '$(inputs.params.DOCKERFILE)', '-t', '$(outputs.resources.image.url)', '.'] + volumeMounts: + - name: varlibcontainers + mountPath: /var/lib/containers + securityContext: + privileged: true + + - name: push-image + image: buildah + workingDir: /workspace/source + command: ['buildah', 'push', '--tls-verify=$(inputs.params.TLSVERIFY)', '$(outputs.resources.image.url)', 'docker://$(outputs.resources.image.url)'] + volumeMounts: + - name: varlibcontainers + mountPath: /var/lib/containers + securityContext: + privileged: true + + volumes: + - name: varlibcontainers + emptyDir: {} \ No newline at end of file diff --git a/pkg/reconciler/openshift/tektonaddon/transformer.go b/pkg/reconciler/openshift/tektonaddon/transformer.go index 5bdb3f3d50..e0f77d1f2e 100644 --- a/pkg/reconciler/openshift/tektonaddon/transformer.go +++ b/pkg/reconciler/openshift/tektonaddon/transformer.go @@ -31,16 +31,7 @@ func replaceKind(fromKind, toKind string) mf.Transformer { if kind != fromKind { return nil } - err := unstructured.SetNestedField(u.Object, toKind, "kind") - if err != nil { - return fmt.Errorf( - "failed to change resource Name:%s, KIND from %s to %s, %s", - u.GetName(), - fromKind, - toKind, - err, - ) - } + u.SetKind(toKind) return nil } } @@ -129,3 +120,16 @@ func replaceURLCCD(baseURL string) mf.Transformer { return nil } } + +func setVersionedNames(operatorVersion string) mf.Transformer { + return func(u *unstructured.Unstructured) error { + if u.GetKind() != "ClusterTask" { + return nil + } + name := u.GetName() + formattedVersion := getFormattedVersion(operatorVersion) + name = fmt.Sprintf("%s-%s", name, formattedVersion) + u.SetName(name) + return nil + } +} diff --git a/pkg/reconciler/openshift/tektonaddon/transformer_test.go b/pkg/reconciler/openshift/tektonaddon/transformer_test.go index 1e6baf9a08..aa36fd5224 100644 --- a/pkg/reconciler/openshift/tektonaddon/transformer_test.go +++ b/pkg/reconciler/openshift/tektonaddon/transformer_test.go @@ -56,3 +56,21 @@ func TestUpdateConsoleCLIDownload(t *testing.T) { t.Errorf("failed to update consoleclidownload %s", diff.PrintWantGot(d)) } } + +func TestSetVersionedNames(t *testing.T) { + testData := path.Join("testdata", "test-versioned-clustertask-name.yaml") + manifest, err := mf.ManifestFrom(mf.Recursive(testData)) + assert.NilError(t, err) + + testData = path.Join("testdata", "test-versioned-clustertask-name-expected.yaml") + expectedManifest, err := mf.ManifestFrom(mf.Recursive(testData)) + assert.NilError(t, err) + + operatorVersion := "v1.7.0" + newManifest, err := manifest.Transform(setVersionedNames(operatorVersion)) + assert.NilError(t, err) + + if d := cmp.Diff(expectedManifest.Resources(), newManifest.Resources()); d != "" { + t.Errorf("failed to update versioned clustertask name %s", diff.PrintWantGot(d)) + } +}