Skip to content

Add RHEL V6 container support [DI-375] #845

Add RHEL V6 container support [DI-375]

Add RHEL V6 container support [DI-375] #845

Workflow file for this run

name: Build PR
on:
workflow_dispatch:
pull_request:
env:
test_container_name_oss: hazelcast-oss-test
test_container_name_ee: hazelcast-ee-test
docker_log_file_oss: docker-hazelcast-oss-test.log
docker_log_file_ee: docker-hazelcast-ee-test.log
jobs:
prepare:
runs-on: ubuntu-latest
name: Prepare environment
outputs:
HZ_VERSION_OSS: ${{ steps.get_oss_vars.outputs.HZ_VERSION_OSS }}
HZ_VERSION_EE: ${{ steps.get_ee_vars.outputs.HZ_VERSION_EE }}
LAST_RELEASED_HZ_VERSION_OSS: ${{ steps.get_oss_vars.outputs.LAST_RELEASED_HZ_VERSION_OSS }}
HAZELCAST_EE_ZIP_URL: ${{ steps.get_ee_vars.outputs.HAZELCAST_EE_ZIP_URL }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Forbid .github/release_type file
run: |
if [ -f ".github/release_type" ]; then
echo "Error: .github/release_type file is not allowed in the PRs. It's used only during release creation"
exit 1
fi
- name: Test scripts
run: |
.github/scripts/test_scripts.sh
- name: Setup OSS variables
id: get_oss_vars
run: |
HZ_VERSION_OSS=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' hazelcast-oss/Dockerfile)
echo "HZ_VERSION_OSS=$HZ_VERSION_OSS" >> $GITHUB_OUTPUT
source hazelcast-oss/maven.functions.sh
LAST_RELEASED_HZ_VERSION_OSS="$(get_latest_version com.hazelcast hazelcast-distribution https://repo1.maven.org/maven2)";
echo "LAST_RELEASED_HZ_VERSION_OSS=$LAST_RELEASED_HZ_VERSION_OSS" >> $GITHUB_OUTPUT
- name: Setup EE variables
id: get_ee_vars
run: |
HZ_VERSION_EE=$(awk -F '=' '/^ARG HZ_VERSION=/ {print $2}' hazelcast-enterprise/Dockerfile)
. .github/scripts/ee-build.functions.sh
echo "HZ_VERSION_EE=$HZ_VERSION_EE" >> $GITHUB_OUTPUT
echo "HAZELCAST_EE_ZIP_URL=$(get_hz_dist_zip "" ${HZ_VERSION_EE})" >> $GITHUB_OUTPUT
build-pr:
runs-on: ubuntu-latest
name: Build with default JDK
needs: [ prepare ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Build OSS image
run: |
DOCKER_PATH=hazelcast-oss
HZ_VERSION="${{ needs.prepare.outputs.HZ_VERSION_OSS }}"
# duplicated block as GH doesn't support passing sensitive data between jobs
. .github/scripts/oss-build.functions.sh
export HZ_SNAPSHOT_INTERNAL_PASSWORD=${{ secrets.HZ_SNAPSHOT_INTERNAL_PASSWORD }}
export HZ_SNAPSHOT_INTERNAL_USERNAME=${{ secrets.HZ_SNAPSHOT_INTERNAL_USERNAME }}
HAZELCAST_OSS_ZIP_URL=$(get_hz_dist_zip "" "${HZ_VERSION}")
curl --fail --silent --show-error --location "$HAZELCAST_OSS_ZIP_URL" --output $DOCKER_PATH/hazelcast-distribution.zip;
docker buildx build --load \
--build-arg HZ_VERSION=${HZ_VERSION} \
--tag hazelcast-oss:test \
${DOCKER_PATH}
- name: Run smoke test against OSS image
timeout-minutes: 2
run: |
. .github/scripts/docker.functions.sh
.github/scripts/simple-smoke-test.sh hazelcast-oss:test ${{ env.test_container_name_oss }} oss ${{ needs.prepare.outputs.HZ_VERSION_OSS }} "$(get_default_jdk hazelcast-oss)"
- name: Build Test EE image
run: |
DOCKER_PATH=hazelcast-enterprise
HZ_VERSION="${{ needs.prepare.outputs.HZ_VERSION_EE }}"
curl --fail --silent --show-error --location "${{ needs.prepare.outputs.HAZELCAST_EE_ZIP_URL }}" --output $DOCKER_PATH/hazelcast-enterprise-distribution.zip;
docker buildx build --load \
--build-arg HZ_VERSION=${HZ_VERSION} \
--tag hazelcast-ee:test \
${DOCKER_PATH}
- name: Run smoke test against EE image
timeout-minutes: 2
run: |
. .github/scripts/docker.functions.sh
export HZ_LICENSEKEY=${{ secrets.HZ_ENTERPRISE_LICENSE }}
.github/scripts/simple-smoke-test.sh hazelcast-ee:test ${{ env.test_container_name_ee }} ee ${{ needs.prepare.outputs.HZ_VERSION_EE }} "$(get_default_jdk hazelcast-enterprise)"
- name: Get docker logs
if: ${{ always() }}
run: |
docker logs ${{ env.test_container_name_oss }} > ${{ env.docker_log_file_oss }}
docker logs ${{ env.test_container_name_ee }} > ${{ env.docker_log_file_ee }}
- name: Store docker logs as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: docker-logs-${{ github.job }}
path: |
${{ env.docker_log_file_oss }}
${{ env.docker_log_file_ee }}
jdks:
uses: ./.github/workflows/get-supported-jdks.yaml
build-pr-custom-jdk:
runs-on: ubuntu-latest
needs: [ jdks, prepare ]
name: Build with jdk-${{ matrix.jdk }}
strategy:
fail-fast: false
matrix:
jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Build OSS image
run: |
DOCKER_PATH=hazelcast-oss
HZ_VERSION="${{ needs.prepare.outputs.HZ_VERSION_OSS }}"
# duplicated block as GH doesn't support passing sensitive data between jobs
. .github/scripts/oss-build.functions.sh
export HZ_SNAPSHOT_INTERNAL_PASSWORD=${{ secrets.HZ_SNAPSHOT_INTERNAL_PASSWORD }}
export HZ_SNAPSHOT_INTERNAL_USERNAME=${{ secrets.HZ_SNAPSHOT_INTERNAL_USERNAME }}
HAZELCAST_OSS_ZIP_URL=$(get_hz_dist_zip "" "${HZ_VERSION}")
curl --fail --silent --show-error --location "$HAZELCAST_OSS_ZIP_URL" --output $DOCKER_PATH/hazelcast-distribution.zip;
docker buildx build --load \
--build-arg JDK_VERSION=${{ matrix.jdk }} \
--build-arg HZ_VERSION=${HZ_VERSION} \
--tag hazelcast-oss:test \
${DOCKER_PATH}
- name: Run smoke test against OSS image
timeout-minutes: 2
run: |
.github/scripts/simple-smoke-test.sh hazelcast-oss:test ${{ env.test_container_name_oss }} oss ${{ needs.prepare.outputs.HZ_VERSION_OSS }} ${{ matrix.jdk }}
- name: Build Test EE image
run: |
DOCKER_PATH=hazelcast-enterprise
HZ_VERSION="${{ needs.prepare.outputs.HZ_VERSION_EE }}"
curl --fail --silent --show-error --location "${{ needs.prepare.outputs.HAZELCAST_EE_ZIP_URL }}" --output $DOCKER_PATH/hazelcast-enterprise-distribution.zip;
docker buildx build --load \
--build-arg JDK_VERSION=${{ matrix.jdk }} \
--build-arg HZ_VERSION=${HZ_VERSION} \
--tag hazelcast-ee:test \
${DOCKER_PATH}
- name: Run smoke test against EE image
timeout-minutes: 2
run: |
export HZ_LICENSEKEY=${{ secrets.HZ_ENTERPRISE_LICENSE }}
.github/scripts/simple-smoke-test.sh hazelcast-ee:test ${{ env.test_container_name_ee }} ee ${{ needs.prepare.outputs.HZ_VERSION_EE }} ${{ matrix.jdk }}
- name: Get docker logs
if: ${{ always() }}
run: |
docker logs ${{ env.test_container_name_oss }} > ${{ env.docker_log_file_oss }}
docker logs ${{ env.test_container_name_ee }} > ${{ env.docker_log_file_ee }}
- name: Store docker logs as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: docker-logs-${{ github.job }}-jdk${{ matrix.jdk }}
path: |
${{ env.docker_log_file_oss }}
${{ env.docker_log_file_ee }}
test-push:
name: Test pushing image (dry run)
needs: [ prepare ]
uses: ./.github/workflows/tag_image_push.yml
with:
HZ_VERSION: ${{ needs.prepare.outputs.LAST_RELEASED_HZ_VERSION_OSS }}
RELEASE_VERSION: ${{ needs.prepare.outputs.LAST_RELEASED_HZ_VERSION_OSS }}
RELEASE_TYPE: ALL
DRY_RUN: true
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_ENTERPRISE_LICENSE: ${{ secrets.HZ_ENTERPRISE_LICENSE }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}