From 8cbee9dab8a4ba9351c85e303d3a1176b01ae101 Mon Sep 17 00:00:00 2001 From: nmirasch Date: Fri, 20 Dec 2024 15:17:42 +0100 Subject: [PATCH 1/2] Create downstream container image for konflux Signed-off-by: nmirasch --- .konflux/Containerfile.plugin | 55 +++++++++++++++++++ ...ft-gitops-console-plugin-pull-request.yaml | 8 ++- .../openshift-gitops-console-plugin-push.yaml | 8 ++- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .konflux/Containerfile.plugin diff --git a/.konflux/Containerfile.plugin b/.konflux/Containerfile.plugin new file mode 100644 index 00000000..a9fc8682 --- /dev/null +++ b/.konflux/Containerfile.plugin @@ -0,0 +1,55 @@ +FROM registry.access.redhat.com/ubi9/nodejs-22:9.5-1734528986 AS builder + +USER root + +# Install Yarn +RUN npm install --global yarn + +COPY ["package.json", "yarn.lock", "./"] + +RUN yarn install --no-progress --non-interactive + +ADD . /usr/src/app +WORKDIR /usr/src/app + +RUN yarn install --network-timeout 600000 && \ + yarn cache clean + +RUN yarn install --no-progress --non-interactive + +COPY [".", "."] + +RUN yarn build + +#################################################################################################### + +FROM --platform=linux/amd64 registry.redhat.io/ubi9/httpd-24:9.5-1733127463 +USER root +RUN chown -R 1001:0 /opt/app-root/src +USER 1001 +RUN chmod g+rwx /opt/app-root/src + +COPY --from=builder /usr/src/app/ssl.conf /etc/httpd/conf.d +COPY --from=builder /usr/src/app/dist /var/www/html/plugin + +CMD run-httpd + +LABEL \ + name="openshift-gitops-1/gitops-rhel8-console-plugin" \ + License="Apache 2.0" \ + com.redhat.component="openshift-gitops-console-plugin-container" \ + com.redhat.delivery.appregistry="false" \ + release=${CI_CONTAINER_RELEASE} \ + upstream-vcs-type="git" \ + upstream-version=${CI_UPSTREAM_VERSION} \ + upstream-vcs-ref="${COMMIT_SHA}" \ + summary="Red Hat OpenShift GitOps Console Plugin" \ + maintainer="William Tam " \ + io.openshift.tags="openshift,gitops-console-plugin" \ + io.k8s.display-name="Red Hat OpenShift GitOps Console Plugin" \ + io.k8s.description="Red Hat OpenShift GitOps Console Plugin" \ + io.openshift.maintainer.product="Red Hat OpenShift GitOps" \ + io.openshift.maintainer.component="William Tam " \ + description="Red Hat OpenShift GitOps Console Plugin" + + diff --git a/.tekton/openshift-gitops-console-plugin-pull-request.yaml b/.tekton/openshift-gitops-console-plugin-pull-request.yaml index c76a58bf..995fd417 100644 --- a/.tekton/openshift-gitops-console-plugin-pull-request.yaml +++ b/.tekton/openshift-gitops-console-plugin-pull-request.yaml @@ -26,8 +26,14 @@ spec: value: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/openshift-gitops-operator/openshift-gitops-console-plugin:on-pr-{{revision}} - name: image-expires-after value: 5d + - name: build-platforms + value: + - linux/x86_64 + - linux/arm64 + - linux/ppc64le + - linux/s390x - name: dockerfile - value: Dockerfile + value: .konflux/Containerfile.plugin pipelineSpec: description: | This pipeline is ideal for building container images from a Containerfile while reducing network traffic. diff --git a/.tekton/openshift-gitops-console-plugin-push.yaml b/.tekton/openshift-gitops-console-plugin-push.yaml index 0277093f..d43416db 100644 --- a/.tekton/openshift-gitops-console-plugin-push.yaml +++ b/.tekton/openshift-gitops-console-plugin-push.yaml @@ -23,8 +23,14 @@ spec: value: '{{revision}}' - name: output-image value: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/openshift-gitops-operator/openshift-gitops-console-plugin:{{revision}} + - name: build-platforms + value: + - linux/x86_64 + - linux/arm64 + - linux/ppc64le + - linux/s390x - name: dockerfile - value: Dockerfile + value: .konflux/Containerfile.plugin pipelineSpec: description: | This pipeline is ideal for building container images from a Containerfile while reducing network traffic. From 41d044bbc0a65d93f0fc71fb78c426514ae1472b Mon Sep 17 00:00:00 2001 From: nmirasch Date: Fri, 20 Dec 2024 15:52:28 +0100 Subject: [PATCH 2/2] adding license and labels Signed-off-by: nmirasch --- .konflux/Containerfile.plugin | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.konflux/Containerfile.plugin b/.konflux/Containerfile.plugin index a9fc8682..a57361c1 100644 --- a/.konflux/Containerfile.plugin +++ b/.konflux/Containerfile.plugin @@ -1,3 +1,19 @@ +# Copyright 2021 Red Hat +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------ + FROM registry.access.redhat.com/ubi9/nodejs-22:9.5-1734528986 AS builder USER root @@ -35,7 +51,7 @@ COPY --from=builder /usr/src/app/dist /var/www/html/plugin CMD run-httpd LABEL \ - name="openshift-gitops-1/gitops-rhel8-console-plugin" \ + name="openshift-gitops-1/gitops-console-plugin-rhel8" \ License="Apache 2.0" \ com.redhat.component="openshift-gitops-console-plugin-container" \ com.redhat.delivery.appregistry="false" \ @@ -43,6 +59,7 @@ LABEL \ upstream-vcs-type="git" \ upstream-version=${CI_UPSTREAM_VERSION} \ upstream-vcs-ref="${COMMIT_SHA}" \ + version=${CI_CONTAINER_VERSION} \ summary="Red Hat OpenShift GitOps Console Plugin" \ maintainer="William Tam " \ io.openshift.tags="openshift,gitops-console-plugin" \