Skip to content

Commit

Permalink
Merge pull request #430 from RADAR-base/release-2.3.0
Browse files Browse the repository at this point in the history
Release 2.3.0
  • Loading branch information
mpgxvii authored Apr 3, 2023
2 parents 992bcae + 8d274e4 commit 25d53a8
Show file tree
Hide file tree
Showing 95 changed files with 853 additions and 668 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
34 changes: 12 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,14 @@ jobs:
# 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@v2
- uses: actions/checkout@v3

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: temurin

- name: Cache
uses: actions/[email protected]
with:
# Cache gradle directories
path: |
~/.gradle/caches/jars-3
~/.gradle/caches/modules-2/files-2.1/
~/.gradle/caches/modules-2/metadata-2.96/
~/.gradle/native
~/.gradle/wrapper
# Key for restoring and saving the cache
key: ${{ runner.os }}-gradle
- uses: gradle/gradle-build-action@v2

# Compile the code
- name: Compile code
Expand Down Expand Up @@ -70,31 +60,31 @@ jobs:
# 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@v2
- uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
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: crazy-max/ghaction-docker-meta@v2
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_IMAGE }}

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

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

- name: Cache Docker layers
id: cache-buildx
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', '**/*.gradle.kts', 'gradle.properties', 'src/main/**') }}
Expand All @@ -111,7 +101,7 @@ jobs:
fi
- name: Build docker
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: ${{ steps.cache-parameters.outputs.cache-to }}
Expand Down
36 changes: 13 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,21 @@ jobs:
# 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@v2
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: temurin

- name: Cache
uses: actions/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: |
~/.gradle/caches/jars-3
~/.gradle/caches/modules-2/files-2.1/
~/.gradle/caches/modules-2/metadata-2.96/
~/.gradle/native
~/.gradle/wrapper
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-gradle
- uses: gradle/gradle-build-action@v2

# Compile code
- name: Compile code
run: ./gradlew assemble

# Upload it to GitHub
- name: Upload to GitHub
uses: AButler/[email protected]
uses: AButler/[email protected].2
with:
files: 'build/libs/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -52,32 +42,32 @@ jobs:

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

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

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

- name: Login to DockerHub
uses: docker/login-action@v1
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: crazy-max/ghaction-docker-meta@v2
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build docker
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
# Allow running the image on the architectures supported by openjdk:17-jre-slim
platforms: linux/amd64,linux/arm64
Expand All @@ -93,4 +83,4 @@ jobs:
- 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 }}
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
29 changes: 12 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
FROM openjdk:11-jdk-slim AS builder
FROM --platform=$BUILDPLATFORM gradle:8.0-jdk17 AS builder

RUN mkdir /code
WORKDIR /code

ENV GRADLE_OPTS -Dorg.gradle.daemon=false

COPY ./gradle /code/gradle
COPY ./gradlew /code/
RUN ./gradlew --version
ENV GRADLE_USER_HOME=/code/.gradlecache \
GRADLE_OPTS='-Djdk.lang.Process.launchMechanism=vfork -Dorg.gradle.daemon=false -Dorg.gradle.vfs.watch=false'

COPY ./build.gradle ./settings.gradle /code/

RUN gradle downloadDependencies copyDependencies

COPY ./src /code/src

RUN ./gradlew unpack
RUN gradle unpack

FROM openjdk:11-jre-slim
FROM eclipse-temurin:17-jre

LABEL maintainer="Yatharth Ranjan <[email protected]>"

LABEL description="RADAR-base App server"

ENV JDK_JAVA_OPTIONS '-Xmx2G -Djava.security.egd=file:/dev/./urandom'
ENV SPRING_PROFILES_ACTIVE prod
ENV JDK_JAVA_OPTIONS='-Xmx2G -Djava.security.egd=file:/dev/./urandom' \
SPRING_PROFILES_ACTIVE=prod

VOLUME /tmp
ARG DEPENDENCY=/code/build/dependency

RUN apt-get update && apt-get install -y \
curl \
wget \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=builder /code/build/third-party/* /app/lib/
COPY --from=builder ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=builder ${DEPENDENCY}/BOOT-INF/classes /app

EXPOSE 8080

ENTRYPOINT [ "java", "-cp", "app:app/lib/*", "org.radarbase.appserver.AppserverApplication"]
ENTRYPOINT [ "java", "-cp", "app:app/lib/*", "org.radarbase.appserver.AppserverApplication"]
Loading

0 comments on commit 25d53a8

Please sign in to comment.