Skip to content
Open

Rel v1 #2346

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
2 changes: 0 additions & 2 deletions .github/dco.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/deploy-and-test-cluster.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: dev-branch

on:
push:
branches:
- dev

jobs:
maven-build-job:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
security-events: write
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: java
- name: package the code
run: mvn clean package
- name: Perform code quality analysis
uses: github/codeql-action/analyze@v4
# - name: publish test results
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# files: '**/target/surefire-reports/**/*.xml'
# comment_mode: always
- name: upload JAR as artifact
uses: actions/upload-artifact@v4
with:
name: spring-petclinic-jar
path: target/*.jar
docker-build-job:
runs-on: ubuntu-latest
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup docker buildx
uses: docker/setup-buildx-action@v4
- name: build the docker image
uses: docker/build-push-action@v7
with:
push: false
tags: spring-petclinic:latest
31 changes: 0 additions & 31 deletions .github/workflows/gradle-build.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: main-branch

on:
workflow_dispatch:
push:
branches:
- main

jobs:
maven-build-job:
runs-on: ubuntu-latest
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: java
- name: package the code
run: mvn --batch-mode -Dmaven.test.failure.ignore=true test
- name: Perform code quality analysis
uses: github/codeql-action/analyze@v4
- name: publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: '**/target/surefire-reports/**/*.xml'
comment_mode: always
docker-build-job:
runs-on: ubuntu-latest
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup docker buildx
uses: docker/setup-buildx-action@v4
- name: build the docker image
uses: docker/build-push-action@v7
with:
push: false
tags: spring-petclinic:latest
29 changes: 0 additions & 29 deletions .github/workflows/maven-build.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: pull-request-workflow

permissions:
checks: write
contents: read

on:
pull_request:
branches:
- dev

jobs:
maven-build-job:
runs-on: ubuntu-latest
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: java
- name: package the code
run: mvn --batch-mode -Dmaven.test.failure.ignore=true test package
- name: Perform code quality analysis
uses: github/codeql-action/analyze@v4
# - name: publish test results
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# files: '**/target/surefire-reports/**/*.xml'
# comment_mode: always
docker-build-job:
runs-on: ubuntu-latest
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup docker buildx
uses: docker/setup-buildx-action@v4
- name: build the docker image
uses: docker/build-push-action@v7
with:
push: false
tags: spring-petclinic:latest
72 changes: 72 additions & 0 deletions .github/workflows/rel_v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: release-branch

on:
push:
branches:
- rel_v1

jobs:
maven-build-job:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
security-events: write
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
server-id: github
settings-path: ${{ github.workspace }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: java

- name: Remove generated toolchains.xml
run: rm -f toolchains.xml
- name: package the code
run: mvn clean package
# - name: Perform code quality analysis
# uses: github/codeql-action/analyze@v4
# - name: publish test results
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# files: '**/target/surefire-reports/**/*.xml'
# comment_mode: always
- name: publish package
run: mvn deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-build-job:
runs-on: ubuntu-latest
steps:
- name: get the code
uses: actions/checkout@v6
- name: setup docker buildx
uses: docker/setup-buildx-action@v4
- name: Login into Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: metadata
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository_owner }}/spring-petclinic

- name: build the docker image
uses: docker/build-push-action@v7
with:
push: true
context: .
tags: |
ghcr.io/${{ github.repository_owner }}/spring-petclinic:latest
ghcr.io/${{ github.repository_owner }}/spring-petclinic:${{ github.sha }}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM eclipse-temurin:21-jdk AS build
WORKDIR /app
COPY .mvn .mvn
COPY mvnw pom.xml .
RUN ./mvnw dependency:go-offline
COPY src src
RUN ./mvnw package -DskipTests


FROM eclipse-temurin:21-jdk
WORKDIR /app
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
1 change: 1 addition & 0 deletions prompts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile: write a multistage Docker file which runs springpetclinic and uses jdk 21