diff --git a/.github/scripts/smoke-test.sh b/.github/scripts/smoke-test.sh index a4f7e3fd..7135e738 100755 --- a/.github/scripts/smoke-test.sh +++ b/.github/scripts/smoke-test.sh @@ -3,23 +3,16 @@ set -e -o pipefail ${RUNNER_DEBUG:+-x} # 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 b32f0a7f..0bb10d4d 100644 --- a/.github/workflows/tag_image_push_rhel.yml +++ b/.github/workflows/tag_image_push_rhel.yml @@ -151,11 +151,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: | @@ -175,15 +176,20 @@ jobs: run: | echo "HZ_MC_VERSION=$(echo "${{ inputs.HZ_VERSION }}" | cut -d '.' -f 1,2)" >> $GITHUB_ENV + - 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" \