Release HiveMQ Platform Operator 1.7.0 #1373
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: Smoke Test | |
on: | |
pull_request: | |
branches: | |
- "**" | |
workflow_dispatch: | |
concurrency: | |
group: smoke-test-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
RELEASE_NAME: "smoke-test-release" | |
jobs: | |
smoke-test-platform: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout HiveMQ Helm Charts | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
path: helm-charts | |
- name: Checkout HiveMQ Platform Operator on the default branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
repository: hivemq/hivemq-platform-operator | |
token: ${{ secrets.JENKINS_GITHUB_TOKEN }} | |
path: hivemq-platform-operator | |
- name: Checkout HiveMQ Platform Operator on the same or target branch | |
working-directory: hivemq-platform-operator | |
run: | | |
echo "Checking if branch \"${GITHUB_HEAD_REF}\" exists on hivemq-platform-operator" | |
BRANCH=$(git ls-remote origin ${GITHUB_HEAD_REF}) | |
if [[ -n "${BRANCH}" ]]; then | |
echo "Checking out branch with the same name" | |
git fetch --all | |
git checkout origin/${GITHUB_HEAD_REF} | |
exit | |
fi | |
if [[ "${GITHUB_BASE_REF}" == "develop" ]]; then | |
exit | |
fi | |
echo "Checking if branch \"${GITHUB_BASE_REF}\" exists on hivemq-platform-operator" | |
BRANCH=$(git ls-remote origin ${GITHUB_BASE_REF}) | |
if [[ -n "${BRANCH}" ]]; then | |
echo "Checking out target branch" | |
git fetch --all | |
git checkout origin/${GITHUB_BASE_REF} | |
fi | |
- name: Set up Docker QEMU | |
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3 | |
- name: Login to Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4 | |
with: | |
gradle-home-cache-includes: | | |
caches | |
notifications | |
jdks | |
- name: Build HiveMQ Platform Operator and HiveMQ Platform Operator Init images | |
working-directory: helm-charts | |
run: ./gradlew :tests-hivemq-platform-operator:build :tests-hivemq-platform-operator:saveDockerImages | |
- name: Create K8s Kind Cluster | |
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 | |
with: | |
cluster_name: "kind" | |
- name: Load local images into KinD cluster | |
working-directory: helm-charts | |
run: | | |
kind load image-archive ./tests-hivemq-platform-operator/build/hivemq-platform-operator-init.tar | |
kind load image-archive ./tests-hivemq-platform-operator/build/hivemq-platform-operator.tar | |
kind load image-archive ./tests-hivemq-platform-operator/build/hivemq-platform.tar | |
- name: Install HiveMQ Platform Operator | |
working-directory: helm-charts | |
run: helm install operator-test --set image.name=hivemq-platform-operator-test --set image.initImageName=hivemq-platform-operator-init-test --set image.tag=snapshot ./charts/hivemq-platform-operator --wait | |
- name: Install HiveMQ Platform | |
working-directory: helm-charts | |
run: helm install $RELEASE_NAME --set nodes.replicaCount=1,nodes.resources.cpu=512m ./charts/hivemq-platform --wait --create-namespace -n test | |
- name: Test HiveMQ Platform | |
run: | | |
kubectl get events -n test -w & | |
# Otherwise the pods are not created and the next step fails | |
echo Waiting for statefulSet to be created && sleep 15 && echo Done Waiting | |
kubectl wait --for=condition=ready pod -l app.kubernetes.io/instance=$RELEASE_NAME --timeout=5m -n test | |
helm test $RELEASE_NAME --logs -n test | |
- name: Capture HiveMQ Platform Pods logs on failure | |
if: failure() | |
run: | | |
mkdir ${{ runner.temp }}/logs | |
kubectl logs -l app.kubernetes.io/instance=$RELEASE_NAME --tail -1 -n default > ${{ runner.temp }}/logs/operator-pod.log | |
kubectl logs -l app.kubernetes.io/instance=$RELEASE_NAME --tail -1 -n test > ${{ runner.temp }}/logs/platform-pod.log | |
- name: Upload HiveMQ Platform Pods logs on failure | |
if: failure() | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 | |
with: | |
name: Pod logs | |
path: ${{ runner.temp }}/logs/*.log | |
retention-days: 5 | |
- name: Uninstall HiveMQ Platform charts | |
if: always() | |
run: | | |
helm uninstall $RELEASE_NAME --wait --ignore-not-found -n test | |
helm uninstall operator-test --wait --ignore-not-found | |
kubectl get pods -A | |
smoke-test-legacy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout HiveMQ Helm Charts | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
path: helm-charts | |
- name: Checkout HiveMQ Legacy Operator on the default branch | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
repository: hivemq/hivemq-operator | |
token: ${{ secrets.JENKINS_GITHUB_TOKEN }} | |
path: hivemq-operator | |
- name: Checkout HiveMQ Legacy Operator on the same or target branch | |
working-directory: hivemq-operator | |
run: | | |
echo "Checking if branch \"${GITHUB_HEAD_REF}\" exists on hivemq-operator" | |
BRANCH=$(git ls-remote origin ${GITHUB_HEAD_REF}) | |
if [[ -n "${BRANCH}" ]]; then | |
echo "Checking out branch with the same name" | |
git fetch --all | |
git checkout origin/${GITHUB_HEAD_REF} | |
exit | |
fi | |
if [[ "${GITHUB_BASE_REF}" == "master" ]]; then | |
exit | |
fi | |
echo "Checking if branch \"${GITHUB_BASE_REF}\" exists on hivemq-operator" | |
BRANCH=$(git ls-remote origin ${GITHUB_BASE_REF}) | |
if [[ -n "${BRANCH}" ]]; then | |
echo "Checking out target branch" | |
git fetch --all | |
git checkout origin/${GITHUB_BASE_REF} | |
fi | |
- name: Set up Docker QEMU | |
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3 | |
- name: Login to Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4 | |
with: | |
gradle-home-cache-includes: | | |
caches | |
notifications | |
jdks | |
- name: Build HiveMQ Legacy Operator images | |
working-directory: helm-charts | |
run: ./gradlew :tests-hivemq-operator:build :tests-hivemq-operator:saveDockerImages | |
- name: Create K8s Kind Cluster | |
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 | |
with: | |
cluster_name: "kind" | |
- name: Load local images into KinD cluster | |
working-directory: helm-charts | |
run: | | |
kind load image-archive ./tests-hivemq-operator/build/hivemq-dns-init-wait.tar | |
kind load image-archive ./tests-hivemq-operator/build/hivemq-k8s.tar | |
kind load image-archive ./tests-hivemq-operator/build/hivemq-operator.tar | |
- name: Install HiveMQ Legacy Operator | |
working-directory: helm-charts | |
run: | | |
helm repo add prometheus https://prometheus-community.github.io/helm-charts | |
helm dependency build ./charts/hivemq-operator | |
helm install $RELEASE_NAME ./charts/hivemq-operator -f ./examples/hivemq-operator/localStatefulTest.yml --wait --create-namespace -n test | |
- name: Test HiveMQ Cluster | |
run: | | |
kubectl get events -n test -w & | |
# Otherwise the pods are not created and the next step fails | |
echo Waiting for statefulSet to be created && sleep 15 && echo Done Waiting | |
kubectl wait --for=condition=ready pod -l hivemq-cluster=$RELEASE_NAME --timeout=5m -n test | |
helm test $RELEASE_NAME --logs -n test | |
- name: Capture HiveMQ Legacy Operator Pods logs on failure | |
if: failure() | |
run: | | |
mkdir ${{ runner.temp }}/logs | |
kubectl logs -l app.kubernetes.io/instance=$RELEASE_NAME --tail -1 -n default > ${{ runner.temp }}/logs/operator-pod.log | |
kubectl logs -l app.kubernetes.io/instance=$RELEASE_NAME --tail -1 -n test > ${{ runner.temp }}/logs/platform-pod.log | |
- name: Upload HiveMQ Legacy Operator Pods logs on failure | |
if: failure() | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 | |
with: | |
name: Pod logs | |
path: ${{ runner.temp }}/logs/*.log | |
retention-days: 5 | |
- name: Uninstall HiveMQ Legacy Operator charts | |
if: always() | |
run: | | |
helm uninstall $RELEASE_NAME --wait --ignore-not-found -n test | |
kubectl get pods -A | |
smoke-test-edge: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout HiveMQ Helm Charts | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
path: helm-charts | |
- name: Create K8s Kind Cluster | |
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 | |
with: | |
cluster_name: "kind" | |
- name: Install HiveMQ Edge | |
working-directory: helm-charts | |
run: helm install $RELEASE_NAME ./charts/hivemq-edge --wait --create-namespace -n test | |
- name: Test HiveMQ Edge | |
run: | | |
kubectl get events -n test -w & | |
# Otherwise the pods are not created and the next step fails | |
echo Waiting for statefulSet to be created && sleep 15 && echo Done Waiting | |
kubectl wait --for=condition=ready pod -l app.kubernetes.io/instance=$RELEASE_NAME --timeout=5m -n test | |
helm test $RELEASE_NAME --logs -n test | |
- name: Capture HiveMQ Edge Pods logs on failure | |
if: failure() | |
run: | | |
mkdir ${{ runner.temp }}/logs | |
kubectl logs -l app.kubernetes.io/instance=$RELEASE_NAME --tail -1 -n default > ${{ runner.temp }}/logs/edge-pod.log | |
- name: Upload HiveMQ Edge Pods logs on failure | |
if: failure() | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 | |
with: | |
name: Pod logs | |
path: ${{ runner.temp }}/logs/*.log | |
retention-days: 5 | |
- name: Uninstall HiveMQ Edge chart | |
if: always() | |
run: | | |
helm uninstall $RELEASE_NAME --wait --ignore-not-found -n test | |
kubectl get pods -A |