Build EE NLC snapshot image #2803
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build EE NLC snapshot image | |
on: | |
workflow_dispatch: | |
inputs: | |
HZ_VERSION: | |
description: 'Version of Hazelcast to build the image for' | |
required: true | |
HZ_EE_REVISION: | |
description: 'Commit id of Hazelcast Enterprise snapshot jar' | |
required: true | |
env: | |
test_container_name_ee: hazelcast-ee-test | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
env: | |
HZ_VERSION : ${{ github.event.inputs.HZ_VERSION }} | |
NLC_REPOSITORY: ${{ secrets.NLC_REPOSITORY }} | |
NLC_REPO_USERNAME: ${{ secrets.NLC_REPO_USERNAME }} | |
NLC_REPO_TOKEN: ${{ secrets.NLC_REPO_TOKEN }} | |
NLC_IMAGE_NAME: ${{ secrets.NLC_IMAGE_NAME }} | |
S3_NLC_URL: ${{ secrets.S3_NLC_URL }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: 'us-east-1' | |
- name: Get presigned NLC URL from S3 | |
run: | | |
ZIP_NAME=hazelcast-enterprise-${HZ_VERSION}-nlc.zip | |
S3_NLC_ZIP_URL=${S3_NLC_URL}/snapshot/${ZIP_NAME} | |
HAZELCAST_ZIP_URL="$(aws s3 presign ${S3_NLC_ZIP_URL} --expires-in 600)" | |
echo "HAZELCAST_ZIP_URL=${HAZELCAST_ZIP_URL}" >> $GITHUB_ENV | |
- name: Login to Docker Hub | |
run: echo "${NLC_REPO_TOKEN}" | docker login -u ${NLC_REPO_USERNAME} ${NLC_REPOSITORY} --password-stdin | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: v0.5.1 | |
- name: Build EE image | |
run: | | |
docker buildx build --load \ | |
--build-arg HZ_VERSION=${HZ_VERSION} \ | |
--build-arg HAZELCAST_ZIP_URL=${HAZELCAST_ZIP_URL} \ | |
--label hazelcast.ee.revision=${{ github.event.inputs.HZ_EE_REVISION }} \ | |
--tag hazelcast-nlc:test hazelcast-enterprise | |
- name: Run smoke test against EE image | |
timeout-minutes: 2 | |
run: | | |
export HZ_INSTANCETRACKING_FILENAME=instance-tracking.txt | |
.github/scripts/simple-smoke-test.sh hazelcast-nlc:test ${{ env.test_container_name_ee }} | |
- name: Get docker logs | |
if: ${{ always() }} | |
run: | | |
DOCKER_LOG_FILE_EE=docker-hazelcast-ee-test.log | |
echo "DOCKER_LOG_FILE_EE=${DOCKER_LOG_FILE_EE}" >> $GITHUB_ENV | |
docker logs ${{ env.test_container_name_ee }} > ${DOCKER_LOG_FILE_EE} | |
- name: Store docker logs as artifact | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docker-logs | |
path: | | |
${{ env.DOCKER_LOG_FILE_EE }} | |
- name: Build/Push EE image | |
run: | | |
docker buildx build --push \ | |
--build-arg HZ_VERSION=${HZ_VERSION} \ | |
--build-arg HAZELCAST_ZIP_URL=${HAZELCAST_ZIP_URL} \ | |
--label hazelcast.ee.revision=${{ github.event.inputs.HZ_EE_REVISION }} \ | |
--tag ${NLC_IMAGE_NAME}:${HZ_VERSION} \ | |
--platform=linux/arm64,linux/amd64 hazelcast-enterprise |