Skip to content

add station to station limiter limiter, significantly improves perfor… #433

add station to station limiter limiter, significantly improves perfor…

add station to station limiter limiter, significantly improves perfor… #433

Workflow file for this run

name: Docker Build
on:
push:
branches:
- main
- development
pull_request:
branches:
- main
- development
permissions:
checks: write
jobs:
validation:
if: github.event_name == 'push' || github.event.pull_request.draft == 'false'
name: "Validate, build and test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Validate maven wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Execute Gradle build --refresh-dependencies
run: ./gradlew build test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Archive code coverage results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "**/reports/*"
retention-days: 30
docker:
needs: validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get version from build.gradle
id: get-version
run: |
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
VERSION=$(grep -oP "[^\S]version\s*=\s*'\K[^']+" build.gradle)-${{ github.event.pull_request.number || github.event.issue.number }}
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
VERSION=$(grep -oP "[^\S]version\s*=\s*'\K[^']+" build.gradle)
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
fi
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Execute Gradle bootBuildImage
run: ./gradlew bootBuildImage --imageName=nexus.edpn.io/edpn/backend/modulith:${{ env.VERSION }}
- name: Build Docker image with wget
run: docker build --build-arg BASE_IMAGE=nexus.edpn.io/edpn/backend/modulith:${{ env.VERSION }} -f Dockerfile-add-packages -t nexus.edpn.io/edpn/backend/modulith:${{ env.VERSION }} .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.NEXUS_USER }}
password: ${{ secrets.NEXUS_PASSWORD }}
registry: nexus.edpn.io
- name: Push Docker image to Nexus registry
run: docker push nexus.edpn.io/edpn/backend/modulith:${{ env.VERSION }}
- name: Add additional tags to Docker image
if: github.event_name != 'pull_request'
run: |
if [[ "${{ github.ref }}" == 'refs/heads/development' ]]; then
docker tag nexus.edpn.io/edpn/backend/modulith:${{ env.VERSION }} nexus.edpn.io/edpn/backend/modulith:latest-snapshot
docker push nexus.edpn.io/edpn/backend/modulith:latest-snapshot
elif [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
docker tag nexus.edpn.io/edpn/backend/modulith:${{ env.VERSION }} nexus.edpn.io/edpn/backend/modulith:latest
docker push nexus.edpn.io/edpn/backend/modulith:latest
fi