From 6ca0297e7b8f6a4b3ef36d57803a3d7f69a83d55 Mon Sep 17 00:00:00 2001 From: Jefferson Ramos Date: Wed, 6 Mar 2024 14:10:53 -0300 Subject: [PATCH 1/2] adding func-deploy-pac override patch --- .../task/func-deploy/0.1/func-deploy-pac.yaml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml diff --git a/openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml b/openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml new file mode 100644 index 0000000000..fa77b4450c --- /dev/null +++ b/openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml @@ -0,0 +1,29 @@ +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: func-deploy + 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" +spec: + description: >- + This Task performs a deploy operation using the Knative `func` CLI + params: + - name: path + description: Path to the function project + default: "" + - name: image + description: Container image to be deployed + default: "" + workspaces: + - name: source + description: The workspace containing the function project + steps: + - name: func-deploy + image: "ghcr.io/knative/func/func:latest" + script: | + func deploy --verbose --build=false --push=false --path=$(params.path) --remote=false --image="$(params.image)" From 4ff73bf10471093a54802009520392b3005061ee Mon Sep 17 00:00:00 2001 From: Jefferson Ramos Date: Thu, 7 Mar 2024 13:57:08 -0300 Subject: [PATCH 2/2] chore: adding func-deploy-pac.yaml patch (using bash script) --- .../task/func-deploy/0.1/func-deploy-pac.yaml | 29 ------------------- openshift/release/update-to-head.sh | 6 ++++ openshift/scripts/generate-tekton-pac.sh | 11 +++++++ 3 files changed, 17 insertions(+), 29 deletions(-) delete mode 100644 openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml create mode 100755 openshift/scripts/generate-tekton-pac.sh diff --git a/openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml b/openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml deleted file mode 100644 index fa77b4450c..0000000000 --- a/openshift/overrides/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy-pac.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: func-deploy - 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" -spec: - description: >- - This Task performs a deploy operation using the Knative `func` CLI - params: - - name: path - description: Path to the function project - default: "" - - name: image - description: Container image to be deployed - default: "" - workspaces: - - name: source - description: The workspace containing the function project - steps: - - name: func-deploy - image: "ghcr.io/knative/func/func:latest" - script: | - func deploy --verbose --build=false --push=false --path=$(params.path) --remote=false --image="$(params.image)" diff --git a/openshift/release/update-to-head.sh b/openshift/release/update-to-head.sh index fe6ad17ad5..98f92cb748 100755 --- a/openshift/release/update-to-head.sh +++ b/openshift/release/update-to-head.sh @@ -49,6 +49,12 @@ if [[ -d openshift/overrides ]]; then cp -r openshift/overrides/. . rm -rf openshift/overrides fi +# Apply midstream patches using scripts +if [[ -d openshift/scripts ]]; then + for script in openshift/scripts/*.sh; do + "$script" + done +fi git add . make generate/zz_filesystem_generated.go diff --git a/openshift/scripts/generate-tekton-pac.sh b/openshift/scripts/generate-tekton-pac.sh new file mode 100755 index 0000000000..373ddbbd81 --- /dev/null +++ b/openshift/scripts/generate-tekton-pac.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -e + +FUNC_S2I="pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i" +FUNC_BUILDPACKS="pkg/pipelines/resources/tekton/task/func-buildpacks/0.2/func-buildpacks" +FUNC_DEPLOY="pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy" + +sed -e 's/^kind: .*/kind: Task/' "${FUNC_S2I}.yaml" > "${FUNC_S2I}-pac.yaml" +sed -e 's/^kind: .*/kind: Task/' "${FUNC_BUILDPACKS}.yaml" > "${FUNC_BUILDPACKS}-pac.yaml" +sed -e 's/^kind: .*/kind: Task/' "${FUNC_DEPLOY}.yaml" > "${FUNC_DEPLOY}-pac.yaml"