Skip to content

Add support for Sentry monitoring #117

Add support for Sentry monitoring

Add support for Sentry monitoring #117

Workflow file for this run

# Continuous integration, including test and integration test
name: Main test
# Run in master and dev branches and in all pull requests to those branches
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
jobs:
# Build and test the code
kotlin:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2
# Compile the code
- name: Compile code
run: ./gradlew assemble
# Gradle check
- name: Check
run: ./gradlew check
# Build and test the code
node:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Use Node.js 14
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
cache-dependency-path: radar-upload-frontend/package-lock.json
# Compile the code
- name: Install dependencies
working-directory: ./radar-upload-frontend
run: npm install
# Compile the code
- name: Build code
working-directory: ./radar-upload-frontend
run: npm run build
docker-backend:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: radarbase/radar-upload-connect-backend
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Docker build parameters
id: docker_params
run: |
echo "::set-output name=has_docker_login::${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}"
if [ "${{ github.event_name == 'pull_request' }}" = "true" ]; then
echo "::set-output name=push::false"
echo "::set-output name=load::true"
echo "::set-output name=platforms::linux/amd64"
else
echo "::set-output name=push::true"
echo "::set-output name=load::false"
echo "::set-output name=platforms::linux/amd64,linux/arm64"
fi
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-backend-${{ hashFiles('radar-upload-backend/Dockerfile', '**/*.gradle.kts', 'gradle.properties', 'radar-upload-backend/src/main/**') }}
restore-keys: |
${{ runner.os }}-buildx-backend-
- name: Cache parameters
id: cache-parameters
run: |
if [ "${{ steps.cache_buildx.outputs.cache-hit }}" = "true" ]; then
echo "::set-output name=cache-to::"
else
echo "::set-output name=cache-to::type=local,dest=/tmp/.buildx-cache-new,mode=max"
fi
- name: Login to DockerHub
if: steps.docker_params.outputs.has_docker_login == 'true'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Add Docker labels and tags
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_IMAGE }}
# Setup docker build environment
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build backend docker
uses: docker/build-push-action@v3
with:
context: .
file: ./radar-upload-backend/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: ${{ steps.cache-parameters.outputs.cache-to }}
platforms: ${{ steps.docker_params.outputs.platforms }}
load: ${{ steps.docker_params.outputs.load }}
push: ${{ steps.docker_params.outputs.push }}
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Joris Borgdorff <[email protected]>, Nivethika Mahasivam <[email protected]>, Pauline Conde <[email protected]>
org.opencontainers.image.description=RADAR-base upload connector backend application
org.opencontainers.image.authors=Joris Borgdorff <[email protected]>, Nivethika Mahasivam <[email protected]>, Pauline Conde <[email protected]>
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
# Push the backend image on the dev and master branches
- name: Pull images
if: steps.docker_params.outputs.load == 'false'
run: docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
- name: Inspect docker images
run: |
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
docker run --rm ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} curl --version
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move docker build cache
if: steps.cache_buildx.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
docker-frontend:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: radarbase/radar-upload-connect-frontend
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Docker build parameters
id: docker_params
run: |
echo "::set-output name=has_docker_login::${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}"
if [ "${{ github.event_name == 'pull_request' }}" = "true" ]; then
echo "::set-output name=push::false"
echo "::set-output name=load::true"
echo "::set-output name=platforms::linux/amd64"
else
echo "::set-output name=push::true"
echo "::set-output name=load::false"
echo "::set-output name=platforms::linux/amd64,linux/arm64"
fi
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-frontend-${{ hashFiles('radar-upload-frontend/**') }}
restore-keys: |
${{ runner.os }}-buildx-frontend-
- name: Cache parameters
id: cache-parameters
run: |
if [ "${{ steps.cache_buildx.outputs.cache-hit }}" = "true" ]; then
echo "::set-output name=cache-to::"
else
echo "::set-output name=cache-to::type=local,dest=/tmp/.buildx-cache-new,mode=max"
fi
- name: Login to DockerHub
if: steps.docker_params.outputs.has_docker_login == 'true'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta frontend
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_IMAGE }}
# Setup docker build environment
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build frontend docker
uses: docker/build-push-action@v3
with:
context: ./radar-upload-frontend
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: ${{ steps.cache-parameters.outputs.cache-to }}
platforms: ${{ steps.docker_params.outputs.platforms }}
load: ${{ steps.docker_params.outputs.load }}
push: ${{ steps.docker_params.outputs.push }}
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Peyman Mohtashami <[email protected]>, Pauline Conde <[email protected]>
org.opencontainers.image.description=RADAR-base upload connector frontend application
org.opencontainers.image.authors=Peyman Mohtashami <[email protected]>, Pauline Conde <[email protected]>
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
# Push the backend image on the dev and master branches
- name: Pull images
if: steps.docker_params.outputs.load == 'false'
run: docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
- name: Inspect docker images
run: docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move docker build cache
if: steps.cache_buildx.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
docker-connector:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: radarbase/radar-connect-upload-source
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Docker build parameters
id: docker_params
run: |
echo "::set-output name=has_docker_login::${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}"
if [ "${{ github.event_name == 'pull_request' }}" = "true" ]; then
echo "::set-output name=push::false"
echo "::set-output name=load::true"
else
echo "::set-output name=push::true"
echo "::set-output name=load::false"
fi
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-connector-${{ hashFiles('kafka-connect-upload-source/Dockerfile', '**/*.gradle.kts', 'gradle.properties', 'kafka-connect-upload-source/src/main/**') }}
restore-keys: |
${{ runner.os }}-buildx-connector-
- name: Cache parameters
id: cache-parameters
run: |
if [ "${{ steps.cache_buildx.outputs.cache-hit }}" = "true" ]; then
echo "::set-output name=cache-to::"
else
echo "::set-output name=cache-to::type=local,dest=/tmp/.buildx-cache-new,mode=max"
fi
- name: Login to DockerHub
if: steps.docker_params.outputs.has_docker_login == 'true'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_IMAGE }}
# Setup docker build environment
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build upload connector docker
uses: docker/build-push-action@v3
with:
context: .
file: ./kafka-connect-upload-source/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: ${{ steps.cache-parameters.outputs.cache-to }}
platforms: linux/amd64
load: ${{ steps.docker_params.outputs.load }}
push: ${{ steps.docker_params.outputs.push }}
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Joris Borgdorff <[email protected]>, Nivethika Mahasivam <[email protected]>, Pauline Conde <[email protected]>
org.opencontainers.image.description=RADAR-base kafka connect upload connector
org.opencontainers.image.authors=Joris Borgdorff <[email protected]>, Nivethika Mahasivam <[email protected]>, Pauline Conde <[email protected]>
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
# Push the backend image on the dev and master branches
- name: Pull images
if: steps.docker_params.outputs.load == 'false'
run: docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
- name: Inspect docker images
run: docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move docker build cache
if: steps.cache_buildx.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache