Build OSS snapshot image #3592
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 OSS snapshot image | |
on: | |
workflow_dispatch: | |
inputs: | |
HZ_VERSION: | |
description: 'Version of Hazelcast to build the image for' | |
required: true | |
HZ_REVISION: | |
description: 'Commit id of Hazelcast snapshot jar' | |
required: true | |
env: | |
test_container_name_oss: hazelcast-oss-test | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- variant: slim | |
suffix: '-slim' | |
- variant: '' | |
suffix: '' | |
env: | |
DOCKER_ORG: hazelcast | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- 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 Test OSS image | |
run: | | |
docker buildx build --load \ | |
--build-arg HZ_VERSION=${{ github.event.inputs.HZ_VERSION }} \ | |
--build-arg HZ_VARIANT=${{ matrix.variant }} \ | |
--tag hazelcast-oss:test \ | |
hazelcast-oss | |
- 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 }} | |
- name: Get docker logs | |
if: ${{ always() }} | |
run: | | |
DOCKER_LOG_FILE_OSS=docker-hazelcast-oss-test${{ matrix.suffix }}.log | |
echo "DOCKER_LOG_FILE_OSS=${DOCKER_LOG_FILE_OSS}" >> $GITHUB_ENV | |
docker logs ${{ env.test_container_name_oss }} > ${DOCKER_LOG_FILE_OSS} | |
- name: Store docker logs as artifact | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docker-logs | |
path: | | |
${{ env.DOCKER_LOG_FILE_OSS }} | |
- name: Login to Docker Hub | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
- name: Build/Push OSS image | |
run: | | |
TAGS="--tag ${{ env.DOCKER_ORG }}/hazelcast:${{ github.event.inputs.HZ_VERSION }}${{ matrix.suffix }}" | |
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then | |
TAGS="${TAGS} --tag ${{ env.DOCKER_ORG }}/hazelcast:latest-snapshot${{ matrix.suffix }}" | |
fi | |
docker buildx build --push \ | |
--build-arg HZ_VERSION=${{ github.event.inputs.HZ_VERSION }} \ | |
--build-arg HZ_VARIANT=${{ matrix.variant }} \ | |
--label hazelcast.revision=${{ github.event.inputs.HZ_REVISION }} \ | |
$TAGS \ | |
--platform=linux/arm64,linux/amd64,linux/ppc64le hazelcast-oss |