Skip to content

ci-v4.x

ci-v4.x #6

Workflow file for this run

name: ci-v4.x
on:
#push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
base_img:
- "adoptopenjdk/openjdk8:jdk8u422-b05-debian"
- "eclipse-temurin:8u422-b05-jdk-noble"
- "eclipse-temurin:21.0.4_7-jdk-noble"
vers:
- "4.9.8"
- "4.9.7"
- "4.9.6"
- "4.9.5"
- "4.9.4"
- "4.9.3"
- "4.9.2"
- "4.9.1"
- "4.9.0"
- "4.8.0"
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
-
name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Build dockerfile (with no push)
run: |
latest=$(cat latest);
echo $latest;
latest_tag="--tag dyrnq/rocketmq:${{ matrix.vers }}";
base_img="${{matrix.base_img}}"
if [[ "${base_img}" =~ "openjdk8" ]]; then
if [[ "${{ matrix.vers }}" = "${latest}" ]]; then
latest_tag="${latest_tag} --tag dyrnq/rocketmq:latest"
fi
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8"
fi
if [[ "${base_img}" =~ "eclipse-temurin:8u422" ]]; then
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8-noble"
fi
if [[ "${base_img}" =~ "eclipse-temurin:21" ]]; then
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21-noble"
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21"
fi
echo $latest_tag;
docker buildx build \
--platform linux/amd64,linux/arm64/v8 \
--output "type=image,push=false" \
--file ./Dockerfile . \
--build-arg version="${{ matrix.vers }}" \
--build-arg BASE_IMAGE="${base_img}" \
$latest_tag
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build dockerfile (with push)
run: |
latest=$(cat latest);
echo $latest;
latest_tag="--tag dyrnq/rocketmq:${{ matrix.vers }}";
base_img="${{matrix.base_img}}"
if [[ "${base_img}" =~ "openjdk8" ]]; then
if [[ "${{ matrix.vers }}" = "${latest}" ]]; then
latest_tag="${latest_tag} --tag dyrnq/rocketmq:latest"
fi
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8"
fi
if [[ "${base_img}" =~ "eclipse-temurin:8u422" ]]; then
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8-noble"
fi
if [[ "${base_img}" =~ "eclipse-temurin:21" ]]; then
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21-noble"
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21"
fi
echo $latest_tag;
docker buildx build \
--platform linux/amd64,linux/arm64/v8 \
--output "type=image,push=true" \
--file ./Dockerfile . \
--build-arg version="${{ matrix.vers }}" \
--build-arg BASE_IMAGE="${base_img}" \
$latest_tag