Skip to content

fix: NPE when frame is missing (#400) #380

fix: NPE when frame is missing (#400)

fix: NPE when frame is missing (#400) #380

name: 2.b Build NiFi Workbench Docker
on:
push:
branches:
- main
- develop
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ldi-workbench-nifi
jobs:
job-build-docker-workbench-nifi:
name: Test build LDES Workbench NiFi Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
# Temporary workaround for buildx problem
# See: https://github.com/docker/build-push-action/issues/761#issuecomment-1383822381
driver-opts: |
image=moby/buildkit:v0.10.6
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 18
- name: Determine version
run: |
export VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout)
echo "version=$VERSION" >> $GITHUB_ENV
- name: Define docker variables
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "IMAGE_TAG=${{ env.version }}" >> $GITHUB_ENV
echo "IMAGES=ldes/${{ env.IMAGE_NAME }}" >> $GITHUB_ENV
if [[ "${{ env.version }}" != *"SNAPSHOT"* ]]; then
echo "LATEST=latest" >> $GITHUB_ENV
fi
else
echo "IMAGE_TAG=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
echo "IMAGES=${{ env.REGISTRY }}/Informatievlaanderen/${{ env.IMAGE_NAME }}" >> $GITHUB_ENV
echo "LATEST=latest" >> $GITHUB_ENV
fi
- name: Log in to the DockerHub Container registry
if: github.ref_name == 'main'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub Container registry
if: github.ref_name != 'main'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: Informatievlaanderen
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGES }}
tags: |
type=raw,value=${{env.IMAGE_TAG}}
type=raw,value=${{env.LATEST}}
- name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/home/runner/.m2 /home/runner/.sonar/cache || true
- name: Build LDES Workbench NiFi Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ldi-nifi.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
NIFI_DOCKER_IMAGE_VERSION=${{ vars.NIFI_DOCKER_IMAGE_VERSION }}
platforms: linux/amd64,linux/arm64