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 diff --git a/.ci/openshift_integration.sh b/.ci/openshift_integration.sh index d4479436f..3cd0c5664 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 [ $# -gt 0 ] + 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