Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 34 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,66 @@ on:
types: [published]

env:
DOCKER_IMAGE: radarbase/radar-data-dashboard-backend
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
IMAGE_NAME: radar-data-dashboard-backend

jobs:
# Build and push tagged release docker image
docker:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup docker build environment
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase image name
run: |
echo "DOCKER_IMAGE=${REGISTRY}/${REPOSITORY,,}/${IMAGE_NAME}" >>${GITHUB_ENV}

# Add Docker labels and tags
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
- name: Build docker
uses: docker/build-push-action@v6
with:
# Allow running the image on the architectures supported by openjdk:11-jre-slim
# Allow running the image on the architectures supported by openjdk:17-jre-slim
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
context: .
# Use runtime labels from docker_meta as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Pim van Nierop <[email protected]>
org.opencontainers.image.authors=Pauline Conde @mpgxvii, Pim van Nierop @pvanierop, Bastiaan de Graaf @bdegraaf1234
org.opencontainers.image.authors=Pim van Nierop <[email protected]>
org.opencontainers.image.description=RADAR-base observations backend for data dashboards
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0

- name: Inspect image
- name: Inspect docker image
run: |
docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
13 changes: 11 additions & 2 deletions .github/workflows/scheduled-snyk-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ on:
workflow_dispatch:

env:
DOCKER_IMAGE: radarbase/radar-data-dashboard-backend
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
IMAGE_NAME: radar-data-dashboard-backend

jobs:
security:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Lowercase image name
run: |
echo "DOCKER_IMAGE=${REGISTRY}/${REPOSITORY,,}/${IMAGE_NAME}" >>${GITHUB_ENV}

- name: Run Snyk to check for vulnerabilities
continue-on-error: true # To make sure that SARIF upload gets called
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/scheduled-snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ on:
jobs:
security:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
uses: snyk/actions/gradle-8-jdk17@master
continue-on-error: true # To make sure that SARIF upload gets called
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: Snyk test

on:
pull_request:
branches: [ main, dev ]

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
uses: snyk/actions/gradle-8-jdk17@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --configuration-matching='^runtimeClasspath$' --severity-threshold=high

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=$BUILDPLATFORM gradle:8.4-jdk17 as builder
FROM --platform=$BUILDPLATFORM gradle:8.13-jdk17 as builder

RUN mkdir /code
WORKDIR /code
Expand Down
27 changes: 0 additions & 27 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*
*/

import org.radarbase.gradle.plugin.radarKotlin
import org.radarbase.gradle.plugin.radarPublishing

plugins {
id("org.radarbase.radar-root-project") version Versions.radarCommons
Expand All @@ -33,28 +31,3 @@ plugins {
radarRootProject {
projectVersion.set(Versions.project)
}

subprojects {
apply(plugin = "org.radarbase.radar-kotlin")
apply(plugin = "org.radarbase.radar-publishing")

radarKotlin {
javaVersion.set(Versions.java)
kotlinVersion.set(Versions.kotlin)
slf4jVersion.set(Versions.slf4j)
log4j2Version.set(Versions.log4j2)
junitVersion.set(Versions.junit)
}

radarPublishing {
githubUrl.set("https://github.com/RADAR-base/radar-data-dashboard-backend")
developers {
developer {
id.set("pvanierop")
name.set("Pim van Nierop")
email.set("[email protected]")
organization.set("radar-base")
}
}
}
}
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

@Suppress("ConstPropertyName")
object Versions {
const val project = "0.2.2"
const val project = "0.2.3"

const val java = 17

const val kotlin = "1.9.10"

const val radarCommons = "1.1.2"
const val radarJersey = "0.11.1"
const val radarCommons = "1.2.4"
const val radarJersey = "0.12.4"
const val postgresql = "42.6.1"
const val ktor = "2.3.5"
const val jedis = "5.0.2"
Expand Down
44 changes: 41 additions & 3 deletions data-dashboard-backend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
/*
*
* * Copyright 2025 The Hyve
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/

import org.radarbase.gradle.plugin.radarKotlin
import org.radarbase.gradle.plugin.radarPublishing

plugins {
application
kotlin("plugin.serialization")
kotlin("plugin.noarg")
kotlin("plugin.jpa")
kotlin("plugin.allopen")
// TODO Remove this when new release of radar-commons is available and used in this project.
// This version has Sentry support built in for radar-kotlin plugin.
id("io.sentry.jvm.gradle") version "4.11.0"
id("org.radarbase.radar-kotlin")
id("org.radarbase.radar-publishing")
}

radarPublishing {
githubUrl.set("https://github.com/RADAR-base/radar-data-dashboard-backend")
developers {
developer {
id.set("pvanierop")
name.set("Pim van Nierop")
email.set("[email protected]")
organization.set("radar-base")
}
}
}

radarKotlin {
log4j2Version.set(Versions.log4j2)
sentryEnabled.set(true)
openTelemetryAgentEnabled.set(true)
}

application {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down