Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolincku committed Jun 15, 2024
0 parents commit 127c883
Show file tree
Hide file tree
Showing 393 changed files with 37,063 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
51 changes: 51 additions & 0 deletions .github/workflows/gradle-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle

name: build image

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: docker/[email protected]
name: Docker login
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- uses: docker/[email protected]
with:
platforms: linux/amd64

- uses: actions/checkout@v4
- name: Server Build and push Docker images
uses: docker/[email protected]
with:
file: Dockerfile-system
platforms: linux/amd64
tags: zerolinck/passiflora-system:latest
push: true

- name: UI Build and push Docker images
uses: docker/[email protected]
with:
file: Dockerfile-ui
platforms: linux/amd64
tags: zerolinck/passiflora-ui:latest
push: true
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### 日志 ###
**/logs
**/.gradle
**/build
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
**/.idea
**/.iws
/**/*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/


**/node_modules
**/dist
5 changes: 5 additions & 0 deletions Dockerfile-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:21-slim
COPY passiflora-server /app/
WORKDIR /app/
RUN ["./gradlew", "dependencies", "--refresh-dependencies"]
RUN rm -rf /app
12 changes: 12 additions & 0 deletions Dockerfile-gateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM zerolinck/passiflora-server-builder AS build
COPY passiflora-server /app
WORKDIR /app
RUN ./gradlew :passiflora-gateway-app:build -x test -Denv=prod

FROM openjdk:21-jdk
ARG JAR_FILE=passiflora-gateway-*.jar
COPY --from=build /app/passiflora-gateway-app/build/libs/${JAR_FILE} /app/app.jar
WORKDIR /app
VOLUME /etc/localtime:/etc/localtime:ro
EXPOSE 51000
ENTRYPOINT java $JAVA_OPTS -jar app.jar
12 changes: 12 additions & 0 deletions Dockerfile-storage
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM zerolinck/passiflora-server-builder AS build
COPY passiflora-server /app
WORKDIR /app
RUN ./gradlew :passiflora-storage-app:build -x test -Denv=prod

FROM openjdk:21-jdk
ARG JAR_FILE=passiflora-storage-*.jar
COPY --from=build /app/passiflora-storage-app/build/libs/${JAR_FILE} /app/app.jar
WORKDIR /app
VOLUME /etc/localtime:/etc/localtime:ro
EXPOSE 51002
ENTRYPOINT java $JAVA_OPTS -jar app.jar
12 changes: 12 additions & 0 deletions Dockerfile-system
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM zerolinck/passiflora-server-builder AS build
COPY passiflora-server /app
WORKDIR /app
RUN ./gradlew :passiflora-system-app:build -x test -Denv=prod

FROM openjdk:21-jdk
ARG JAR_FILE=passiflora-system-*.jar
COPY --from=build /app/passiflora-system-app/build/libs/${JAR_FILE} /app/app.jar
WORKDIR /app
VOLUME /etc/localtime:/etc/localtime:ro
EXPOSE 51001
ENTRYPOINT java $JAVA_OPTS -jar app.jar
10 changes: 10 additions & 0 deletions Dockerfile-ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:20 AS build
COPY passiflora-ui /app
WORKDIR /app
RUN npm install
RUN npm run build

FROM nginx:1.21
COPY passiflora-ui/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist /usr/share/nginx/dist
VOLUME /etc/localtime:/etc/localtime:ro
16 changes: 16 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pipeline {
agent any
environment {
def change = ''
}
stages {
stage('Deploy') {
steps {
script {
change = getChanges()
}
sh 'docker-compose up -d --build'
}
}
}
}
Loading

0 comments on commit 127c883

Please sign in to comment.