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
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
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
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '17' ]
|
||||
|
||||
steps:
|
||||
|
||||
- uses: azure/setup-kubectl@v4
|
||||
with:
|
||||
id: install
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout code
|
||||
|
||||
- name: Set up JDK ${{matrix.java}}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{matrix.java}}
|
||||
distribution: 'adopt'
|
||||
distribution: 'temurin'
|
||||
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
|
||||
spring.thymeleaf.mode=HTML
|
||||
|
||||
|
||||
# JPA
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.jpa.open-in-view=false
|
||||
|
|
Loading…
Reference in a new issue