Skip to content

Commit

Permalink
Explicitly install OpenShift CLI tools as not included in latest GitH…
Browse files Browse the repository at this point in the history
…ub Runner image [DI-396]

The latest GitHub `ubuntu-24.04` runner image [no longer includes the OpenShift CLI](actions/runner-images#10636), which has cause [unexpected action failures](https://github.com/hazelcast/hazelcast-docker/actions/runs/12684539163):
`oc: command not found.

Changes:
- Explicitly install the OpenShift tools [(as per `hazelcast-platform-operator)](https://github.com/search?q=repo%3Ahazelcast%2Fhazelcast-platform-operator%20redhat-actions%2Fopenshift-tools-installer&type=code)
- Replace explicit `oc login` command (requiring the `oc` binary) with cross-platform action

Fixes: [DI-396](https://hazelcast.atlassian.net/browse/DI-396)

Post-merge actions:
- [ ] backport to maintenance branches
  • Loading branch information
JackPGreen committed Jan 9, 2025
1 parent e94e50d commit 7371f96
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
23 changes: 8 additions & 15 deletions .github/scripts/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@ 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}"
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
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/tag_image_push_rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,25 @@ 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

- uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "latest"
source: github
skip_cache: 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" \
Expand Down

0 comments on commit 7371f96

Please sign in to comment.