From dc0ba878c1dc46e58f03e3f3e4251021033c0463 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5?= <184172133@qq.com>
Date: Fri, 29 Mar 2024 07:11:28 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5=EF=BC=8Cfeat?=
=?UTF-8?q?=EF=BC=9Amaven=20=E5=B7=A5=E7=A8=8B=E8=84=9A=E6=89=8B=E6=9E=B6?=
=?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0redis=E5=AE=89=E8=A3=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
scaffold-lite/README.md | 4 +-
scaffold-lite/pom.xml | 30 +++---
.../src/main/resources/application-dev.yml | 1 +
...compose-1.0.yml => docker-compose-app.yml} | 4 +-
.../dev-ops/docker-compose-environment.yml | 96 +++++++++++++++++++
.../docs/dev-ops/mysql/docker-compose.yml | 29 ------
.../docs/dev-ops/redis/redis.conf | 2 +
7 files changed, 118 insertions(+), 48 deletions(-)
rename scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/{app/docker-compose-1.0.yml => docker-compose-app.yml} (84%)
create mode 100644 scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/docker-compose-environment.yml
delete mode 100644 scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/mysql/docker-compose.yml
create mode 100644 scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/redis/redis.conf
diff --git a/scaffold-lite/README.md b/scaffold-lite/README.md
index 728f216..2153c34 100644
--- a/scaffold-lite/README.md
+++ b/scaffold-lite/README.md
@@ -5,8 +5,8 @@
### 1. 生成
```shell
-md5 ddd-scaffold-lite-1.0.pom > ddd-scaffold-lite-1.0.pom.md5
-shasum ddd-scaffold-lite-1.0.pom > ddd-scaffold-lite-1.0.pom.sha1
+md5 ddd-scaffold-lite-1.1.pom > ddd-scaffold-lite-1.1.pom.md5
+shasum ddd-scaffold-lite-1.1.pom > ddd-scaffold-lite-1.1.pom.sha1
```
```shell
diff --git a/scaffold-lite/pom.xml b/scaffold-lite/pom.xml
index 9c1607f..b572de3 100644
--- a/scaffold-lite/pom.xml
+++ b/scaffold-lite/pom.xml
@@ -5,7 +5,7 @@
io.github.fuzhengwei
ddd-scaffold-lite
- 1.0
+ 1.1
maven-archetype
ddd-scaffold-lite
@@ -79,20 +79,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
org.apache.maven.plugins
maven-release-plugin
diff --git a/scaffold-lite/src/main/resources/archetype-resources/__rootArtifactId__-app/src/main/resources/application-dev.yml b/scaffold-lite/src/main/resources/archetype-resources/__rootArtifactId__-app/src/main/resources/application-dev.yml
index 2533fa0..34818b9 100644
--- a/scaffold-lite/src/main/resources/archetype-resources/__rootArtifactId__-app/src/main/resources/application-dev.yml
+++ b/scaffold-lite/src/main/resources/archetype-resources/__rootArtifactId__-app/src/main/resources/application-dev.yml
@@ -33,6 +33,7 @@ spring:
connection-test-query: SELECT 1
type: com.zaxxer.hikari.HikariDataSource
+# MyBatis 配置【如需使用记得打开】
#mybatis:
# mapper-locations: classpath:/mybatis/mapper/*.xml
# config-location: classpath:/mybatis/config/mybatis-config.xml
diff --git a/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/app/docker-compose-1.0.yml b/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/docker-compose-app.yml
similarity index 84%
rename from scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/app/docker-compose-1.0.yml
rename to scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/docker-compose-app.yml
index 3e0fa1b..3bda59f 100644
--- a/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/app/docker-compose-1.0.yml
+++ b/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/docker-compose-app.yml
@@ -1,9 +1,9 @@
# /usr/local/bin/docker-compose -f /docs/dev-ops/environment/environment-docker-compose-2.4.yml up -d
version: '3.8'
-# docker-compose -f docker-compose-1.0.yml up -d
+# docker-compose -f docker-compose-app.yml up -d
# 你需要修改system为你自身系统的仓库名
services:
- x-api-app:
+ ${artifactId}:
image: system/${artifactId}:${version}
container_name: ${artifactId}
restart: on-failure
diff --git a/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/docker-compose-environment.yml b/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/docker-compose-environment.yml
new file mode 100644
index 0000000..61a90ce
--- /dev/null
+++ b/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/docker-compose-environment.yml
@@ -0,0 +1,96 @@
+# 命令执行 docker-compose -f docker-compose-environment.yml up -d
+version: '3.9'
+services:
+ mysql:
+ image: mysql:8.0.32
+ container_name: mysql
+ command: --default-authentication-plugin=mysql_native_password
+ restart: always
+ environment:
+ TZ: Asia/Shanghai
+ MYSQL_ROOT_PASSWORD: 123456
+ networks:
+ - my-network
+ depends_on:
+ - mysql-job-dbdata
+ ports:
+ - "13306:3306"
+ volumes:
+ - ./mysql/sql:/docker-entrypoint-initdb.d
+ healthcheck:
+ test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
+ interval: 5s
+ timeout: 10s
+ retries: 10
+ start_period: 15s
+ volumes_from:
+ - mysql-job-dbdata
+
+ # 自动加载数据
+ mysql-job-dbdata:
+ image: alpine:3.18.2
+ container_name: mysql-job-dbdata
+ volumes:
+ - /var/lib/mysql
+
+ # phpmyadmin https://hub.docker.com/_/phpmyadmin
+ phpmyadmin:
+ image: phpmyadmin:5.2.1
+ container_name: phpmyadmin
+ hostname: phpmyadmin
+ ports:
+ - 8899:80
+ environment:
+ - PMA_HOST=mysql
+ - PMA_PORT=3306
+ - MYSQL_ROOT_PASSWORD=123456
+ depends_on:
+ mysql:
+ condition: service_healthy
+ networks:
+ - my-network
+
+ # Redis
+ redis:
+ image: redis:6.2
+ container_name: redis
+ restart: always
+ hostname: redis
+ privileged: true
+ ports:
+ - 16379:6379
+ volumes:
+ - ./redis/redis.conf:/usr/local/etc/redis/redis.conf
+ command: redis-server /usr/local/etc/redis/redis.conf
+ networks:
+ - my-network
+ healthcheck:
+ test: [ "CMD", "redis-cli", "ping" ]
+ interval: 10s
+ timeout: 5s
+ retries: 3
+
+ # RedisAdmin https://github.com/joeferner/redis-commander
+ redis-admin:
+ image: spryker/redis-commander:0.8.0
+ container_name: redis-admin
+ hostname: redis-commander
+ restart: always
+ ports:
+ - 8081:8081
+ environment:
+ - REDIS_HOSTS=local:redis:6379
+ - HTTP_USER=admin
+ - HTTP_PASSWORD=admin
+ - LANG=C.UTF-8
+ - LANGUAGE=C.UTF-8
+ - LC_ALL=C.UTF-8
+ networks:
+ - my-network
+ depends_on:
+ redis:
+ condition: service_healthy
+
+networks:
+ my-network:
+ driver: bridge
\ No newline at end of file
diff --git a/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/mysql/docker-compose.yml b/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/mysql/docker-compose.yml
deleted file mode 100644
index f7930e8..0000000
--- a/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/mysql/docker-compose.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-# 命令执行 docker-compose up -d
-version: '3.9'
-services:
- mysql:
- image: mysql:8.0.32
- container_name: mysql
- command: --default-authentication-plugin=mysql_native_password
- restart: always
- environment:
- TZ: Asia/Shanghai
- # MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' # 可配置无密码,注意配置 SPRING_DATASOURCE_PASSWORD=
- MYSQL_ROOT_PASSWORD: 123456
- MYSQL_USER: xfg
- MYSQL_PASSWORD: 123456
- depends_on:
- - mysql-job-dbdata
- ports:
- - "3306:3306"
- volumes:
- - ./sql:/docker-entrypoint-initdb.d
- volumes_from:
- - mysql-job-dbdata
-
- # 自动加载数据
- mysql-job-dbdata:
- image: alpine:3.18.2
- container_name: mysql-job-dbdata
- volumes:
- - /var/lib/mysql
\ No newline at end of file
diff --git a/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/redis/redis.conf b/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/redis/redis.conf
new file mode 100644
index 0000000..f6f3781
--- /dev/null
+++ b/scaffold-lite/src/main/resources/archetype-resources/docs/dev-ops/redis/redis.conf
@@ -0,0 +1,2 @@
+bind 0.0.0.0
+port 6379
\ No newline at end of file
--
GitLab