Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update ci operator scripts to set architecture #419

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 14 additions & 2 deletions .ci/openshift_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading