mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-29 14:29:37 +00:00
Adding workflow
This commit is contained in:
parent
d7cc02f3d7
commit
cf2b0dfff6
3 changed files with 46 additions and 8 deletions
44
.github/workflows/maven-build.yml
vendored
44
.github/workflows/maven-build.yml
vendored
|
@ -4,26 +4,54 @@
|
||||||
name: Java CI with Maven
|
name: Java CI with Maven
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
env:
|
||||||
|
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
||||||
|
ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
|
||||||
|
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
|
||||||
|
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: [ '17' ]
|
java: [ '17' ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- uses: azure/setup-kubectl@v4
|
||||||
|
with:
|
||||||
|
id: install
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
name: Checkout code
|
||||||
|
|
||||||
- name: Set up JDK ${{matrix.java}}
|
- name: Set up JDK ${{matrix.java}}
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: ${{matrix.java}}
|
java-version: ${{matrix.java}}
|
||||||
distribution: 'adopt'
|
distribution: 'temurin'
|
||||||
cache: maven
|
cache: maven
|
||||||
- name: Build with Maven Wrapper
|
|
||||||
run: ./mvnw -B verify
|
- name: Add executable permissions
|
||||||
|
run: chmod a+x mvnw
|
||||||
|
|
||||||
|
- name: Maven install dependencies
|
||||||
|
run: ./mvnw clean install package
|
||||||
|
|
||||||
|
- name: Upload JAR artifact
|
||||||
|
uses: actions/upload-artifact@4
|
||||||
|
with:
|
||||||
|
name: grid-capstone
|
||||||
|
path: ./target/*.jar
|
||||||
|
|
||||||
|
- name: Azure CLI script
|
||||||
|
uses: azure/cli@v2
|
||||||
|
with:
|
||||||
|
azcliversion: latest
|
||||||
|
inlineScript: |
|
||||||
|
az account show
|
||||||
|
az storage -h
|
||||||
|
|
||||||
|
|
||||||
|
|
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
FROM eclipse-temurin:17-jdk-alpine@sha256:b16e661d76d3af0d226d0585063dbcafe7fb8a4ef31cfcaaec71d39c41269420
|
||||||
|
RUN apk add --no-cache iproute2
|
||||||
|
RUN mkdir /app
|
||||||
|
RUN addgroup --system javauser && adduser -S -s /bin/false -G javauser javauser
|
||||||
|
COPY ./target/*.jar /app/java-application.jar
|
||||||
|
WORKDIR /app
|
||||||
|
RUN chown -R javauser:javauser /app
|
||||||
|
USER javauser
|
||||||
|
CMD ["java", "-jar", "java-application.jar"]
|
|
@ -6,6 +6,7 @@ spring.sql.init.data-locations=classpath*:db/${database}/data.sql
|
||||||
# Web
|
# Web
|
||||||
spring.thymeleaf.mode=HTML
|
spring.thymeleaf.mode=HTML
|
||||||
|
|
||||||
|
|
||||||
# JPA
|
# JPA
|
||||||
spring.jpa.hibernate.ddl-auto=none
|
spring.jpa.hibernate.ddl-auto=none
|
||||||
spring.jpa.open-in-view=false
|
spring.jpa.open-in-view=false
|
||||||
|
|
Loading…
Reference in a new issue