From 1a0f9bf023830244e6a432fd00a44ec2592cef52 Mon Sep 17 00:00:00 2001 From: Jack Green Date: Thu, 9 Jan 2025 14:30:24 +0000 Subject: [PATCH] Explicitly install OpenShift CLI tools as not included in latest GitHub Runner image [5.3.8] --- .github/scripts/smoke-test.sh | 27 +++++++++-------------- .github/workflows/tag_image_push_rhel.yml | 21 +++++++++++------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/scripts/smoke-test.sh b/.github/scripts/smoke-test.sh index 78d58d03..98eccf3e 100755 --- a/.github/scripts/smoke-test.sh +++ b/.github/scripts/smoke-test.sh @@ -4,23 +4,16 @@ set -e set -o pipefail # Fill the variables before running the script -WORKDIR=$1 -PROJECT=$2 -OCP_LOGIN_USERNAME=$3 -OCP_LOGIN_PASSWORD=$4 -OCP_CLUSTER_URL=$5 -SCAN_REGISTRY_USER=$6 -SCAN_REGISTRY_PASSWORD=$7 -SCAN_REPOSITORY=$8 -RELEASE_VERSION=$9 -HAZELCAST_CLUSTER_SIZE=${10} -HZ_ENTERPRISE_LICENSE=${11} -HZ_MC_VERSION=${12} -SCAN_REGISTRY=${13} -LOGIN_COMMAND="oc login ${OCP_CLUSTER_URL} -u=${OCP_LOGIN_USERNAME} -p=${OCP_LOGIN_PASSWORD} --insecure-skip-tls-verify" - -# LOG INTO OpenShift -eval "${LOGIN_COMMAND}" +WORKDIR=${1} +PROJECT=${2} +SCAN_REGISTRY_USER=${3} +SCAN_REGISTRY_PASSWORD=${4} +SCAN_REPOSITORY=${5} +RELEASE_VERSION=${6} +HAZELCAST_CLUSTER_SIZE=${7} +HZ_ENTERPRISE_LICENSE=${8} +HZ_MC_VERSION=${9} +SCAN_REGISTRY=${10} # CREATE PROJECT oc new-project $PROJECT diff --git a/.github/workflows/tag_image_push_rhel.yml b/.github/workflows/tag_image_push_rhel.yml index 27e9faea..99adbeb1 100644 --- a/.github/workflows/tag_image_push_rhel.yml +++ b/.github/workflows/tag_image_push_rhel.yml @@ -138,11 +138,12 @@ jobs: ${TAGS_ARG} \ --platform=${PLATFORMS} $DOCKER_DIR - - name: Install preflight tool - run: | - PREFLIGHT_VERSION=$(curl -s https://api.github.com/repos/redhat-openshift-ecosystem/openshift-preflight/releases/latest | grep 'tag_name' | cut -d\" -f4) - wget https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/${PREFLIGHT_VERSION}/preflight-linux-amd64 - chmod +x preflight-linux-amd64 + - uses: redhat-actions/openshift-tools-installer@v1 + with: + oc: "latest" + preflight: "latest" + source: github + skip_cache: true - name: Run preflight scan run: | @@ -158,15 +159,19 @@ jobs: wait_for_container_scan "$RHEL_PROJECT_ID" "$VERSION" "$RHEL_API_KEY" "$TIMEOUT_IN_MINS" + - uses: redhat-actions/oc-login@v1 + with: + openshift_server_url: ${{ env.OCP_CLUSTER_URL }} + openshift_username: ${{ env.OCP_LOGIN_USERNAME }} + openshift_password: ${{ env.OCP_LOGIN_PASSWORD }} + insecure_skip_tls_verify: true + - name: Deploy Hazelcast Cluster run: | WORKDIR=$(pwd)/.github/scripts .github/scripts/smoke-test.sh \ "$WORKDIR" \ "$PROJECT_NAME" \ - "$OCP_LOGIN_USERNAME" \ - "$OCP_LOGIN_PASSWORD" \ - "$OCP_CLUSTER_URL" \ "$SCAN_REGISTRY_USER" \ "$SCAN_REGISTRY_PASSWORD" \ "$SCAN_REPOSITORY" \