From 17ec8c2c7c2bcdb545186757c7a4828d7ca66ba9 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Fri, 7 Jun 2024 11:59:20 -0400 Subject: [PATCH 1/3] update ci operator scripts to set architecture Signed-off-by: Jordan Dubrick --- .ci/openshift_integration.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.ci/openshift_integration.sh b/.ci/openshift_integration.sh index d4479436f..95dd18565 100755 --- a/.ci/openshift_integration.sh +++ b/.ci/openshift_integration.sh @@ -34,15 +34,27 @@ YQ_VERSION=${YQ_VERSION:-v4.44.1} IMG="$(echo $REGISTRY_IMAGE | cut -d':' -f1)" TAG="$(echo $REGISTRY_IMAGE | cut -d':' -f2)" +# Allow for yq dependency to be set based off desired architecture +DEFAULT_ARCH="amd64" + +# Check if different architecture was passed for image build +# Will default to $DEFAULT_ARCH if unset +if [ ! -z "$1" ] + then + arch="$1" +else + arch="$DEFAULT_ARCH" +fi + # Create a project/namespace for running the tests in oc new-project devfile-registry-test # Install yq -curl -sL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -o yq && chmod +x yq +curl -sL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${arch} -o yq && chmod +x yq YQ_PATH=$(realpath yq) # Download odo -curl -sL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v2.5.1/odo-linux-amd64 -o odo && chmod +x odo +curl -sL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v2.5.1/odo-linux-${arch} -o odo && chmod +x odo export GLOBALODOCONFIG=$(pwd)/preferences.yaml # Install the devfile registry From 8cf6b5e52aa7ee6d39600be8a21435fedf23b1f4 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Fri, 7 Jun 2024 15:40:55 -0400 Subject: [PATCH 2/3] change targetarch to buildarch Signed-off-by: Jordan Dubrick --- .ci/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.ci/Dockerfile b/.ci/Dockerfile index 63afe90ad..b2768ff75 100644 --- a/.ci/Dockerfile +++ b/.ci/Dockerfile @@ -17,12 +17,11 @@ FROM registry.access.redhat.com/ubi8/go-toolset:1.21 AS builder # Set user as root USER root -# Automatically set when --platform flag is set, will default to amd64 if no platform is given -ARG TARGETARCH=amd64 +ARG BUILDARCH # Install yq ENV YQ_VERSION=v4.44.1 -RUN curl -sL -O https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH} -o /usr/local/bin/yq && mv ./yq_linux_${TARGETARCH} /usr/local/bin/yq && chmod +x /usr/local/bin/yq +RUN curl -sL -O https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${BUILDARCH} -o /usr/local/bin/yq && mv ./yq_linux_${BUILDARCH} /usr/local/bin/yq && chmod +x /usr/local/bin/yq COPY . /registry From 56df475502abfecb0033eae53b8ead8f099baedb Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 13 Jun 2024 09:20:43 -0400 Subject: [PATCH 3/3] change condition Signed-off-by: Jordan Dubrick --- .ci/openshift_integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/openshift_integration.sh b/.ci/openshift_integration.sh index 95dd18565..3cd0c5664 100755 --- a/.ci/openshift_integration.sh +++ b/.ci/openshift_integration.sh @@ -39,7 +39,7 @@ DEFAULT_ARCH="amd64" # Check if different architecture was passed for image build # Will default to $DEFAULT_ARCH if unset -if [ ! -z "$1" ] +if [ $# -gt 0 ] then arch="$1" else