diff --git a/.tekton/costmanagement-metrics-operator-bundle-pull-request.yaml b/.tekton/bundle-pr.yaml similarity index 98% rename from .tekton/costmanagement-metrics-operator-bundle-pull-request.yaml rename to .tekton/bundle-pr.yaml index 0783700b..97527082 100644 --- a/.tekton/costmanagement-metrics-operator-bundle-pull-request.yaml +++ b/.tekton/bundle-pr.yaml @@ -7,14 +7,19 @@ metadata: build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "3" - pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch - == "downstream" + pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "downstream" && + ( + ".tekton/bundle-pr.yaml".pathChanged() || + "bundle/metadata/***".pathChanged() || + "bundle/manifests/***".pathChanged() || + "bundle.Dockerfile".pathChanged() + ) creationTimestamp: null labels: appstudio.openshift.io/application: costmanagement-metrics-operator appstudio.openshift.io/component: costmanagement-metrics-operator-bundle pipelines.appstudio.openshift.io/type: build - name: costmanagement-metrics-operator-bundle-on-pull-request + name: downstream-operator-bundle-pr namespace: cost-mgmt-dev-tenant spec: params: diff --git a/.tekton/costmanagement-metrics-operator-bundle-push.yaml b/.tekton/bundle-push.yaml similarity index 98% rename from .tekton/costmanagement-metrics-operator-bundle-push.yaml rename to .tekton/bundle-push.yaml index c2441c89..74800163 100644 --- a/.tekton/costmanagement-metrics-operator-bundle-push.yaml +++ b/.tekton/bundle-push.yaml @@ -6,14 +6,19 @@ metadata: build.appstudio.redhat.com/commit_sha: '{{revision}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "3" - pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch - == "downstream" + pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "downstream" && + ( + ".tekton/bundle-push.yaml".pathChanged() || + "bundle/metadata/***".pathChanged() || + "bundle/manifests/***".pathChanged() || + "bundle.Dockerfile".pathChanged() + ) creationTimestamp: null labels: appstudio.openshift.io/application: costmanagement-metrics-operator appstudio.openshift.io/component: costmanagement-metrics-operator-bundle pipelines.appstudio.openshift.io/type: build - name: costmanagement-metrics-operator-bundle-on-push + name: downstream-operator-bundle-push namespace: cost-mgmt-dev-tenant spec: params: diff --git a/.tekton/costmanagement-metrics-operator-pull-request.yaml b/.tekton/operator-pr.yaml similarity index 98% rename from .tekton/costmanagement-metrics-operator-pull-request.yaml rename to .tekton/operator-pr.yaml index 0dd431ba..b0e832f3 100644 --- a/.tekton/costmanagement-metrics-operator-pull-request.yaml +++ b/.tekton/operator-pr.yaml @@ -7,14 +7,17 @@ metadata: build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "3" - pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch - == "downstream" + pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "downstream" && + ( + ".tekton/operator-push.yaml".pathChanged() || + "Dockerfile".pathChanged() + ) creationTimestamp: null labels: appstudio.openshift.io/application: costmanagement-metrics-operator appstudio.openshift.io/component: costmanagement-metrics-operator pipelines.appstudio.openshift.io/type: build - name: costmanagement-metrics-operator-on-pull-request + name: downstream-operator-pr namespace: cost-mgmt-dev-tenant spec: params: @@ -106,8 +109,10 @@ spec: name: build-args-file type: string - default: - - linux/x86_64 + - linux/amd64 - linux/arm64 + - linux/s390x + - linux/ppc64le description: List of platforms to build the container images on. The available set of values is determined by the configuration of the multi-platform-controller. name: build-platforms diff --git a/.tekton/costmanagement-metrics-operator-push.yaml b/.tekton/operator-push.yaml similarity index 98% rename from .tekton/costmanagement-metrics-operator-push.yaml rename to .tekton/operator-push.yaml index c9cf5be2..fa444345 100644 --- a/.tekton/costmanagement-metrics-operator-push.yaml +++ b/.tekton/operator-push.yaml @@ -6,14 +6,17 @@ metadata: build.appstudio.redhat.com/commit_sha: '{{revision}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "3" - pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch - == "downstream" + pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "downstream" && + ( + ".tekton/operator-push.yaml".pathChanged() || + "Dockerfile".pathChanged() + ) creationTimestamp: null labels: appstudio.openshift.io/application: costmanagement-metrics-operator appstudio.openshift.io/component: costmanagement-metrics-operator pipelines.appstudio.openshift.io/type: build - name: costmanagement-metrics-operator-on-push + name: downstream-operator-push namespace: cost-mgmt-dev-tenant spec: params: @@ -103,8 +106,10 @@ spec: name: build-args-file type: string - default: - - linux/x86_64 + - linux/amd64 - linux/arm64 + - linux/s390x + - linux/ppc64le description: List of platforms to build the container images on. The available set of values is determined by the configuration of the multi-platform-controller. name: build-platforms diff --git a/Dockerfile b/Dockerfile index 95c0f4a5..f20f0e78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM --platform=${BUILDPLATFORM:-linux/amd64} brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22 AS builder +ARG TARGETOS +ARG TARGETARCH + USER root WORKDIR /workspace diff --git a/bundle.Dockerfile b/bundle.Dockerfile index d4be6228..315eeabc 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -18,8 +18,8 @@ COPY bundle/metadata /metadata/ # Openshift specific labels LABEL io.k8s.display-name='Cost Management Metrics Operator' LABEL io.k8s.description='Component required to gather metrics from Prometheus, package and upload them to the cost management service in the cloud. The operator can work in clusters connected to the Internet and air-gapped (with additional configuration and steps)' -LABEL io.openshift.build.commit.id=REPLACE_REF -LABEL io.openshift.build.commit.url=https://github.com/project-koku/koku-metrics-operator/commit/REPLACE_REF +LABEL io.openshift.build.commit.id='6b4d72a4a629527c1de086b416faf6d226fe587a' +LABEL io.openshift.build.commit.url='https://github.com/project-koku/koku-metrics-operator/commit/6b4d72a4a629527c1de086b416faf6d226fe587a' LABEL io.openshift.build.source-location=https://github.com/project-koku/koku-metrics-operator LABEL io.openshift.maintainer.component='Cost Management Metrics Operator' LABEL io.openshift.maintainer.product='OpenShift Container Platform'