diff --git a/.tekton/jetstack-cert-manager-1-15-pull-request.yaml b/.tekton/jetstack-cert-manager-1-15-pull-request.yaml index 40a60471..1bfa69a9 100644 --- a/.tekton/jetstack-cert-manager-1-15-pull-request.yaml +++ b/.tekton/jetstack-cert-manager-1-15-pull-request.yaml @@ -35,15 +35,10 @@ spec: value: . - name: build-platforms value: - - linux/x86_64 - - linux/s390x - - linux/ppc64le - - linux/arm64 - - name: build-args - value: - - "RELEASE_VERSION=v1.15.2" - - "COMMIT_SHA={{revision}}" - - "SOURCE_URL={{source_url}}" + - linux/x86_64 + - linux/s390x + - linux/ppc64le + - linux/arm64 - name: prefetch-input value: '{"type": "gomod", "path": "cert-manager"}' pipelineSpec: @@ -189,6 +184,38 @@ spec: workspaces: - name: basic-auth workspace: git-auth + - name: fetch-repository-details + runAfter: + - clone-repository + taskSpec: + results: + - name: release_version + description: "release version of the component" + - name: commit_sha + description: "latest commit hash of the component repository" + - name: source_url + description: "source url of the component repository" + - name: parent_commit_sha + description: "latest commit hash of the parent repository hosting the component" + - name: parent_source_url + description: "source url of the parent repository hosting the component" + steps: + - name: store-repo-details + image: quay.io/konflux-ci/appstudio-utils@sha256:28d4a7609b7e1b11a6c273dad4aabc24f90f2e79ff4b0b2852822da1ab53204a + script: | + #!/usr/bin/env bash + set -e + + cd cert-manager + git remote get-url origin | tr -d '\n' | tee "$(results.source_url.path)" + git rev-parse HEAD | tr -d '\n' | tee "$(results.commit_sha.path)" + cd - + git remote get-url origin | tr -d '\n' | tee "$(results.parent_source_url.path)" + git rev-parse HEAD | tr -d '\n' | tee "$(results.parent_commit_sha.path)" + cat cert-manager-release-version | tr -d '\n' | tee "$(results.release_version.path)" + workspaces: + - name: basic-auth + workspace: git-auth - name: prefetch-dependencies params: - name: input @@ -200,7 +227,7 @@ spec: - name: ociArtifactExpiresAfter value: $(params.image-expires-after) runAfter: - - clone-repository + - fetch-repository-details taskRef: params: - name: name @@ -238,7 +265,11 @@ spec: value: $(tasks.clone-repository.results.commit) - name: BUILD_ARGS value: - - $(params.build-args[*]) + - "RELEASE_VERSION=$(tasks.fetch-repository-details.results.release_version)" + - "COMMIT_SHA=$(tasks.fetch-repository-details.results.commit_sha)" + - "SOURCE_URL=$(tasks.fetch-repository-details.results.source_url)" + - "PARENT_COMMIT_SHA=$(tasks.fetch-repository-details.results.parent_commit_sha)" + - "PARENT_SOURCE_URL=$(tasks.fetch-repository-details.results.parent_source_url)" - name: BUILD_ARGS_FILE value: $(params.build-args-file) - name: SOURCE_ARTIFACT diff --git a/.tekton/jetstack-cert-manager-1-15-push.yaml b/.tekton/jetstack-cert-manager-1-15-push.yaml index 391fdbf7..638997ed 100644 --- a/.tekton/jetstack-cert-manager-1-15-push.yaml +++ b/.tekton/jetstack-cert-manager-1-15-push.yaml @@ -32,15 +32,10 @@ spec: value: . - name: build-platforms value: - - linux/x86_64 - - linux/s390x - - linux/ppc64le - - linux/arm64 - - name: build-args - value: - - "RELEASE_VERSION=v1.15.2" - - "COMMIT_SHA={{revision}}" - - "SOURCE_URL={{source_url}}" + - linux/x86_64 + - linux/s390x + - linux/ppc64le + - linux/arm64 - name: prefetch-input value: '{"type": "gomod", "path": "cert-manager"}' pipelineSpec: @@ -186,6 +181,38 @@ spec: workspaces: - name: basic-auth workspace: git-auth + - name: fetch-repository-details + runAfter: + - clone-repository + taskSpec: + results: + - name: release_version + description: "release version of the component" + - name: commit_sha + description: "latest commit hash of the component repository" + - name: source_url + description: "source url of the component repository" + - name: parent_commit_sha + description: "latest commit hash of the parent repository hosting the component" + - name: parent_source_url + description: "source url of the parent repository hosting the component" + steps: + - name: store-repo-details + image: quay.io/konflux-ci/appstudio-utils@sha256:28d4a7609b7e1b11a6c273dad4aabc24f90f2e79ff4b0b2852822da1ab53204a + script: | + #!/usr/bin/env bash + set -e + + cd cert-manager + git remote get-url origin | tr -d '\n' | tee "$(results.source_url.path)" + git rev-parse HEAD | tr -d '\n' | tee "$(results.commit_sha.path)" + cd - + git remote get-url origin | tr -d '\n' | tee "$(results.parent_source_url.path)" + git rev-parse HEAD | tr -d '\n' | tee "$(results.parent_commit_sha.path)" + cat cert-manager-release-version | tr -d '\n' | tee "$(results.release_version.path)" + workspaces: + - name: basic-auth + workspace: git-auth - name: prefetch-dependencies params: - name: input @@ -197,7 +224,7 @@ spec: - name: ociArtifactExpiresAfter value: $(params.image-expires-after) runAfter: - - clone-repository + - fetch-repository-details taskRef: params: - name: name @@ -235,7 +262,11 @@ spec: value: $(tasks.clone-repository.results.commit) - name: BUILD_ARGS value: - - $(params.build-args[*]) + - "RELEASE_VERSION=$(tasks.fetch-repository-details.results.release_version)" + - "COMMIT_SHA=$(tasks.fetch-repository-details.results.commit_sha)" + - "SOURCE_URL=$(tasks.fetch-repository-details.results.source_url)" + - "PARENT_COMMIT_SHA=$(tasks.fetch-repository-details.results.parent_commit_sha)" + - "PARENT_SOURCE_URL=$(tasks.fetch-repository-details.results.parent_source_url)" - name: BUILD_ARGS_FILE value: $(params.build-args-file) - name: SOURCE_ARTIFACT diff --git a/Containerfile.cert-manager b/Containerfile.cert-manager index 88d8c2c8..94c26fca 100644 --- a/Containerfile.cert-manager +++ b/Containerfile.cert-manager @@ -19,10 +19,14 @@ FROM registry.redhat.io/rhel9-4-els/rhel:9.4 # Values for below ARGs will passed from tekton configs for konflux builds. ## Release version of the cert-manager source code used in the build. ARG RELEASE_VERSION -## Commit hash that considered for the image build. +## Commit hash of the cert-manager repository that is considered for the image build. ARG COMMIT_SHA ## github URL of the cert-manager source repository. ARG SOURCE_URL +## Commit hash of the cert-manager-release repository that is considered for the image build. +ARG PARENT_COMMIT_SHA +## github URL of the cert-manager-release source repository. +ARG PARENT_SOURCE_URL ARG SOURCE_DIR="/go/src/github.com/openshift/jetstack-cert-manager" COPY --from=builder $SOURCE_DIR/_output/acmesolver /app/cmd/acmesolver/acmesolver @@ -42,7 +46,10 @@ LABEL com.redhat.component="jetstack-cert-manager-container" \ io.openshift.expose-services="" \ io.openshift.tags="data,images,cert-manager" \ io.openshift.build.commit.id="${COMMIT_SHA}" \ + io.openshift.build.parent.commit.id="${PARENT_COMMIT_SHA}" \ io.openshift.build.source-location="${SOURCE_URL}" \ + io.openshift.build.parent.source-location="${PARENT_SOURCE_URL}" \ io.openshift.build.commit.url="${SOURCE_URL}/commit/${COMMIT_SHA}" \ + io.openshift.build.parent.commit.url="${PARENT_SOURCE_URL}/commit/${PARENT_COMMIT_SHA}" \ io.k8s.display-name="cert-manager-controller" \ io.k8s.description="jetstack-cert-manager-container" diff --git a/cert-manager-operator-release-version b/cert-manager-operator-release-version new file mode 100644 index 00000000..440ddd8f --- /dev/null +++ b/cert-manager-operator-release-version @@ -0,0 +1 @@ +v1.15.0 diff --git a/cert-manager-release-version b/cert-manager-release-version new file mode 100644 index 00000000..c2c536ea --- /dev/null +++ b/cert-manager-release-version @@ -0,0 +1 @@ +v1.15.2