Skip to content

Commit

Permalink
Fix test_published_images.yml [DI-316] (#827)
Browse files Browse the repository at this point in the history
The action added in
#814 could not be
properly tested via GitHub until merged and at that point additional
defects were discovered.

[Example of now successful
completion](https://github.com/hazelcast/hazelcast-docker/actions/runs/11943342729).

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

[DI-316]:
https://hazelcast.atlassian.net/browse/DI-316?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
JackPGreen committed Nov 21, 2024
1 parent 143dd81 commit 27cbc93
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/test_published_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
inputs:
IMAGE_VERSION:
required: true
description: A version, `5.4.1`, `latest` etc
description: The version/label of the image e.g. `5.4.1`, `latest` etc
EXPECTED_HZ_VERSION:
description: A fully-qualified version, e.g. `5.4.1`
description: The expected Hazelcast version (fully-qualified), e.g. `5.4.1`
required: true
DISTRIBUTION_TYPE:
required: true
description: The distribution(s) to test (case-sensitive)
description: The distribution(s) to test
type: choice
options:
- oss
Expand Down Expand Up @@ -39,25 +39,25 @@ jobs:
run: |
case "${{ inputs.DISTRIBUTION_TYPE }}" in
"oss")
matrix=["oss"]
matrix='["oss"]'
;;
"ee")
matrix=["ee"]
matrix='["ee"]'
;;
"all")
matrix=["oss","ee"]
matrix='["oss","ee"]'
;;
*)
echoerr "Unrecognized distribution type ${{ matrix.distribution_type }}"
echoerr "Unrecognized distribution type ${{ inputs.DISTRIBUTION_TYPE }}"
exit 1
;;
esac
echo "distribution-type-matrix=$matrix" >> $GITHUB_OUTPUT
echo "distribution-type-matrix=${matrix}" >> $GITHUB_OUTPUT
# https://unix.stackexchange.com/a/719752 + trim
# Add an "empty" option for base image
matrix=$(echo '"${{ inputs.OTHER_JDKS }}"' | jq --compact-output 'split(",") + [""] | map(gsub("^\\s+|\\s+$"; ""))' )
echo "jdk-image-variants-matrix=$matrix" >> $GITHUB_OUTPUT
echo "jdk-image-variants-matrix=${matrix}" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
Expand All @@ -68,7 +68,7 @@ jobs:
variant:
- ''
- 'slim'
distribution_type: ${{ fromJson(needs.set-matrix.outputs.distribution-type-matrix) }}
distribution-type: ${{ fromJson(needs.set-matrix.outputs.distribution-type-matrix) }}
jdk-image-variant: ${{ fromJson(needs.set-matrix.outputs.jdk-image-variants-matrix) }}

steps:
Expand Down Expand Up @@ -101,15 +101,15 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to NLC Repository
if: matrix.distribution_type == 'ee'
if: matrix.distribution-type == 'ee'
uses: docker/login-action@v3
with:
registry: ${{ secrets.NLC_REPOSITORY }}
username: ${{ secrets.NLC_REPO_USERNAME }}
password: ${{ secrets.NLC_REPO_TOKEN }}

- name: Login to Red Hat Catalog
if: matrix.distribution_type == 'ee'
if: matrix.distribution-type == 'ee'
uses: docker/login-action@v3
with:
registry: registry.connect.redhat.com
Expand All @@ -136,10 +136,10 @@ jobs:
fi
# Compute tag by concatenating tag_elements
.github/scripts/simple-smoke-test.sh "${organization}/${image_name}":$(IFS=- ; echo "${tag_elements[*]}") "${CONTAINER_NAME}" "${{ matrix.distribution_type }}" "${{ inputs.EXPECTED_HZ_VERSION }}" "${expected_jdk_version}"
.github/scripts/simple-smoke-test.sh "${organization}/${image_name}":$(IFS=- ; echo "${tag_elements[*]}") "${CONTAINER_NAME}" "${{ matrix.distribution-type }}" "${{ inputs.EXPECTED_HZ_VERSION }}" "${expected_jdk_version}"
}
case "${{ matrix.distribution_type }}" in
case "${{ matrix.distribution-type }}" in
"oss")
image_name="hazelcast"
;;
Expand All @@ -148,12 +148,12 @@ jobs:
;;
*)
# Impossible as validated earlier
echoerr "Unrecognized distribution type ${{ matrix.distribution_type }}"
echoerr "Unrecognized distribution type ${{ matrix.distribution-type }}"
exit 1
;;
esac
if [[ "${{ matrix.distribution_type }}" == "ee" ]]; then
if [[ "${{ matrix.distribution-type }}" == "ee" ]]; then
export HZ_LICENSEKEY=${{ secrets.HZ_ENTERPRISE_LICENSE }}
export HZ_INSTANCETRACKING_FILENAME=instance-tracking.txt
fi
Expand All @@ -175,7 +175,7 @@ jobs:
# Check additional EE repos
# Only populated for default variant, not "slim"
if [[ "${{ matrix.distribution_type }}" == "ee" && -z "${{ matrix.variant }}" ]]; then
if [[ "${{ matrix.distribution-type }}" == "ee" && -z "${{ matrix.variant }}" ]]; then
# NLC repo only populated for absolute versions - not "latest", "latest-lts" etc tags
# Identify absolute version based on earlier parsing of version number
if [[ -n "${{ steps.version.outputs.major }}" ]]; then
Expand Down

0 comments on commit 27cbc93

Please sign in to comment.