This commit is contained in:
parent
2d17db6496
commit
1b3af2d2b3
|
|
@ -0,0 +1,75 @@
|
|||
on:
|
||||
#release:
|
||||
#types: [published]
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
build-image:
|
||||
runs-on: ubuntu-act-latest
|
||||
steps:
|
||||
-
|
||||
name: Check Out Repo
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
#with:
|
||||
#repository: jj/paolu-mybatis
|
||||
#path: master
|
||||
#token: ''
|
||||
- name: Set Java Action
|
||||
id: steps1
|
||||
uses: https://github.com/actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
#cache: maven
|
||||
#cache-dependency-path: .pom.xml
|
||||
-
|
||||
name: Set Maven Action
|
||||
uses: https://github.com/stCarolas/setup-maven@v5
|
||||
with:
|
||||
maven-version: 3.9.6
|
||||
-
|
||||
name: Cache
|
||||
uses: actions/cache@v4
|
||||
id: cache1
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
#- name: Set repo-java-maven Env
|
||||
#uses: https://github.com/s4u/setup-maven-action@v1.11.0
|
||||
#with:
|
||||
#java-distribution: temurin
|
||||
#java-version: 20
|
||||
#maven-version: 3.9.5
|
||||
- if: ${{ steps.cache1.outputs.cache-hit == 'true' }}
|
||||
name: is hit cache
|
||||
continue-on-error: true
|
||||
run: echo " hit cache ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}"
|
||||
-
|
||||
name: Build With Maven
|
||||
run: mvn -B package -Dmaven.test.skip
|
||||
- name: Uzip
|
||||
run: mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
|
||||
#-
|
||||
#name: set up qemu
|
||||
#uses: https://github.com/docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set Docker Buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Login To Zot
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
registry: zot.164500.xyz
|
||||
username: test
|
||||
password: test
|
||||
-
|
||||
name: Build And Push Image To Zot
|
||||
uses: https://github.com/docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: zot.164500.xyz/jj/yx:latest
|
||||
31
Dockerfile
31
Dockerfile
|
|
@ -1,18 +1,19 @@
|
|||
FROM docker.io/maven:3.9.6-amazoncorretto-21-debian as build
|
||||
WORKDIR /workspace
|
||||
COPY pom.xml .
|
||||
COPY src src
|
||||
COPY libs libs
|
||||
RUN ls
|
||||
RUN --mount=type=cache,target=/root/.m2,id=my_m2,sharing=locked \
|
||||
mvn package -Dmaven.test.skip
|
||||
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
|
||||
|
||||
#FROM maven:3.9.1-eclipse-temurin-20-alpine as build
|
||||
#WORKDIR /workspace
|
||||
#COPY pom.xml .
|
||||
#COPY src src
|
||||
#RUN --mount=type=cache,target=/root/.m2,id=m2,sharing=locked \
|
||||
#mvn package -Dmaven.test.skip
|
||||
#RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
|
||||
#
|
||||
FROM docker.io/eclipse-temurin:21-jre-alpine
|
||||
ARG DEPENDENCY=/workspace/target/dependency
|
||||
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
|
||||
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
|
||||
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
|
||||
WORKDIR /app
|
||||
COPY target/dependency/BOOT-INF/lib /app/lib
|
||||
COPY target/dependency/META-INF /app/META-INF
|
||||
COPY target/dependency/BOOT-INF/classes /app
|
||||
RUN ls
|
||||
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
RUN echo "Asia/Shanghai" > /etc/timezone
|
||||
ENTRYPOINT ["java","-cp","app:app/lib/*","jj.tech.paolu.Application","--spring.profiles.active=prod"]
|
||||
|
||||
ENTRYPOINT ["java","-cp","/app:/app/lib/*","jj.tech.finance.Application","--spring.profiles.active=prod"]
|
||||
|
|
@ -13,17 +13,18 @@ spring:
|
|||
# password:
|
||||
# hikari:
|
||||
# driver-class-name: org.h2.Driver
|
||||
# url: jdbc:mariadb://192.168.0.123:3306/zwyy
|
||||
# username: root
|
||||
# password: test000000
|
||||
# hikari:
|
||||
# driver-class-name: org.mariadb.jdbc.Driver
|
||||
# driver-class-name: org.h2.Driver
|
||||
url: jdbc:postgresql://192.168.0.123:5434/ailt_0611
|
||||
username: postgres
|
||||
password: mysecretpassword
|
||||
url: jdbc:mariadb://173.249.207.93:3306/yx
|
||||
username: root
|
||||
password: test000000
|
||||
hikari:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
driver-class-name: org.mariadb.jdbc.Driver
|
||||
# driver-class-name: org.h2.Driver
|
||||
|
||||
# url: jdbc:postgresql://192.168.0.123:5434/ailt_0611
|
||||
# username: postgres
|
||||
# password: mysecretpassword
|
||||
# hikari:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user