暂存提交
This commit is contained in:
@@ -13,6 +13,7 @@ data/
|
|||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
!.env.example
|
!.env.example
|
||||||
|
!.env.*.example
|
||||||
application-local.yml
|
application-local.yml
|
||||||
bootstrap-local.yml
|
bootstrap-local.yml
|
||||||
*.hprof
|
*.hprof
|
||||||
|
|||||||
Vendored
+3
-1
@@ -73,6 +73,8 @@ pipeline {
|
|||||||
|
|
||||||
environment {
|
environment {
|
||||||
REGISTRY_CREDENTIALS = 'gitlab-registry-credentials'
|
REGISTRY_CREDENTIALS = 'gitlab-registry-credentials'
|
||||||
|
MAVEN_SETTINGS = 'deploy/maven/settings-cn.xml'
|
||||||
|
MAVEN_OPTS = '-Dfile.encoding=UTF-8 -Dmaven.wagon.http.retryHandler.count=3'
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@@ -128,7 +130,7 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
String testOption = params.SKIP_TESTS ? '-DskipTests' : ''
|
String testOption = params.SKIP_TESTS ? '-DskipTests' : ''
|
||||||
sh "mvn --batch-mode --errors --fail-at-end -pl ${env.SELECTED_SERVICES} -am clean package ${testOption}"
|
sh "mvn --settings ${env.MAVEN_SETTINGS} --batch-mode --errors --fail-at-end -pl ${env.SELECTED_SERVICES} -am clean package ${testOption}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
|
|||||||
+15
-12
@@ -2,7 +2,7 @@ name: firstleg-${DEPLOY_ENV:-test}
|
|||||||
|
|
||||||
x-common: &common
|
x-common: &common
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks: [firstleg-network]
|
networks: [firstleg-network, infra-network]
|
||||||
environment: &common-environment
|
environment: &common-environment
|
||||||
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-cn}
|
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-cn}
|
||||||
NACOS_SERVER_ADDR: ${NACOS_SERVER_ADDR}
|
NACOS_SERVER_ADDR: ${NACOS_SERVER_ADDR}
|
||||||
@@ -30,7 +30,7 @@ services:
|
|||||||
gateway:
|
gateway:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/gateway:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/gateway:${IMAGE_TAG}
|
||||||
container_name: firstleg-gateway
|
container_name: firstleg-${DEPLOY_ENV:-test}-gateway
|
||||||
ports: ["${GATEWAY_PORT:-9000}:9000"]
|
ports: ["${GATEWAY_PORT:-9000}:9000"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -42,7 +42,7 @@ services:
|
|||||||
auth:
|
auth:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/auth:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/auth:${IMAGE_TAG}
|
||||||
container_name: firstleg-auth
|
container_name: firstleg-${DEPLOY_ENV:-test}-auth
|
||||||
ports: ["${AUTH_PORT:-9100}:9100"]
|
ports: ["${AUTH_PORT:-9100}:9100"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -54,7 +54,7 @@ services:
|
|||||||
iam:
|
iam:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/iam:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/iam:${IMAGE_TAG}
|
||||||
container_name: firstleg-iam
|
container_name: firstleg-${DEPLOY_ENV:-test}-iam
|
||||||
ports: ["${IAM_PORT:-9201}:9201"]
|
ports: ["${IAM_PORT:-9201}:9201"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -66,7 +66,7 @@ services:
|
|||||||
firstleg:
|
firstleg:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/firstleg:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/firstleg:${IMAGE_TAG}
|
||||||
container_name: firstleg-business
|
container_name: firstleg-${DEPLOY_ENV:-test}-business
|
||||||
ports: ["${FIRSTLEG_PORT:-9202}:9202"]
|
ports: ["${FIRSTLEG_PORT:-9202}:9202"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -78,7 +78,7 @@ services:
|
|||||||
order:
|
order:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/order:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/order:${IMAGE_TAG}
|
||||||
container_name: firstleg-order
|
container_name: firstleg-${DEPLOY_ENV:-test}-order
|
||||||
ports: ["${ORDER_PORT:-9204}:9204"]
|
ports: ["${ORDER_PORT:-9204}:9204"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -90,7 +90,7 @@ services:
|
|||||||
warehouse:
|
warehouse:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/warehouse:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/warehouse:${IMAGE_TAG}
|
||||||
container_name: firstleg-warehouse
|
container_name: firstleg-${DEPLOY_ENV:-test}-warehouse
|
||||||
ports: ["${WAREHOUSE_PORT:-9205}:9205"]
|
ports: ["${WAREHOUSE_PORT:-9205}:9205"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -102,7 +102,7 @@ services:
|
|||||||
file:
|
file:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/file:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/file:${IMAGE_TAG}
|
||||||
container_name: firstleg-file
|
container_name: firstleg-${DEPLOY_ENV:-test}-file
|
||||||
ports: ["${FILE_PORT:-9206}:9206"]
|
ports: ["${FILE_PORT:-9206}:9206"]
|
||||||
volumes: ["firstleg-file-data:/data/files"]
|
volumes: ["firstleg-file-data:/data/files"]
|
||||||
environment:
|
environment:
|
||||||
@@ -116,7 +116,7 @@ services:
|
|||||||
print:
|
print:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/print:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/print:${IMAGE_TAG}
|
||||||
container_name: firstleg-print
|
container_name: firstleg-${DEPLOY_ENV:-test}-print
|
||||||
ports: ["${PRINT_PORT:-9207}:9207"]
|
ports: ["${PRINT_PORT:-9207}:9207"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -128,7 +128,7 @@ services:
|
|||||||
integration-service:
|
integration-service:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/integration-service:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/integration-service:${IMAGE_TAG}
|
||||||
container_name: firstleg-integration
|
container_name: firstleg-${DEPLOY_ENV:-test}-integration
|
||||||
ports: ["${INTEGRATION_PORT:-9210}:9210"]
|
ports: ["${INTEGRATION_PORT:-9210}:9210"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -147,7 +147,7 @@ services:
|
|||||||
event-bridge-service:
|
event-bridge-service:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/event-bridge-service:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/event-bridge-service:${IMAGE_TAG}
|
||||||
container_name: firstleg-event-bridge
|
container_name: firstleg-${DEPLOY_ENV:-test}-event-bridge
|
||||||
ports: ["${EVENT_BRIDGE_PORT:-9300}:9300"]
|
ports: ["${EVENT_BRIDGE_PORT:-9300}:9300"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -159,7 +159,7 @@ services:
|
|||||||
audit-service:
|
audit-service:
|
||||||
<<: *common
|
<<: *common
|
||||||
image: ${IMAGE_REPOSITORY}/audit-service:${IMAGE_TAG}
|
image: ${IMAGE_REPOSITORY}/audit-service:${IMAGE_TAG}
|
||||||
container_name: firstleg-audit
|
container_name: firstleg-${DEPLOY_ENV:-test}-audit
|
||||||
ports: ["${AUDIT_PORT:-9700}:9700"]
|
ports: ["${AUDIT_PORT:-9700}:9700"]
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
@@ -171,6 +171,9 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
firstleg-network:
|
firstleg-network:
|
||||||
name: firstleg-${DEPLOY_ENV:-test}-network
|
name: firstleg-${DEPLOY_ENV:-test}-network
|
||||||
|
infra-network:
|
||||||
|
external: true
|
||||||
|
name: ${INFRA_NETWORK:-firstleg-test-infra-network}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
firstleg-file-data:
|
firstleg-file-data:
|
||||||
|
|||||||
@@ -18,10 +18,6 @@ if [ ! -f "$ENV_FILE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
SERVICES=$(printf '%s' "$SERVICE_CSV" | tr ',' ' ')
|
SERVICES=$(printf '%s' "$SERVICE_CSV" | tr ',' ' ')
|
||||||
case " $SERVICES " in
|
|
||||||
*" gateway "*) SERVICES="$SERVICES" ;;
|
|
||||||
*) SERVICES="$SERVICES gateway" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
export DEPLOY_ENV IMAGE_REPOSITORY IMAGE_TAG
|
export DEPLOY_ENV IMAGE_REPOSITORY IMAGE_TAG
|
||||||
docker compose \
|
docker compose \
|
||||||
|
|||||||
+20
-18
@@ -1,9 +1,9 @@
|
|||||||
name: baiyue-infra
|
name: firstleg-test-infra
|
||||||
|
|
||||||
services:
|
services:
|
||||||
nacos:
|
nacos:
|
||||||
image: nacos/nacos-server:v2.3.2
|
image: docker.m.daocloud.io/nacos/nacos-server:v2.3.2
|
||||||
container_name: baiyue-nacos
|
container_name: firstleg-test-nacos
|
||||||
environment:
|
environment:
|
||||||
MODE: standalone
|
MODE: standalone
|
||||||
PREFER_HOST_MODE: hostname
|
PREFER_HOST_MODE: hostname
|
||||||
@@ -25,21 +25,20 @@ services:
|
|||||||
networks: [baiyue]
|
networks: [baiyue]
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:8.0.39
|
image: docker.m.daocloud.io/library/mysql:8.0.39
|
||||||
container_name: baiyue-mysql
|
container_name: firstleg-test-mysql
|
||||||
profiles: [database]
|
|
||||||
environment:
|
environment:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-change-me-before-use}
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?请在.env中设置MYSQL_ROOT_PASSWORD}
|
||||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-baiyue}
|
MYSQL_DATABASE: ${MYSQL_DATABASE:-baiyue}
|
||||||
MYSQL_USER: ${MYSQL_USER:-baiyue}
|
MYSQL_USER: ${MYSQL_USER:-baiyue}
|
||||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-change-me-before-use}
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:?请在.env中设置MYSQL_PASSWORD}
|
||||||
command:
|
command:
|
||||||
- --character-set-server=utf8mb4
|
- --character-set-server=utf8mb4
|
||||||
- --collation-server=utf8mb4_0900_ai_ci
|
- --collation-server=utf8mb4_0900_ai_ci
|
||||||
- --default-time-zone=+08:00
|
- --default-time-zone=+08:00
|
||||||
ports: ["3306:3306"]
|
ports: ["3306:3306"]
|
||||||
volumes: [baiyue-mysql-data:/var/lib/mysql]
|
volumes: [firstleg-test-mysql-data:/var/lib/mysql]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u root -p$$MYSQL_ROOT_PASSWORD --silent"]
|
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u root -p$$MYSQL_ROOT_PASSWORD --silent"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
@@ -50,14 +49,15 @@ services:
|
|||||||
networks: [baiyue]
|
networks: [baiyue]
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7.2.5-alpine
|
image: docker.m.daocloud.io/library/redis:7.2.5-alpine
|
||||||
container_name: baiyue-redis
|
container_name: firstleg-test-redis
|
||||||
profiles: [cache]
|
command: ["sh", "-c", "exec redis-server --appendonly yes --requirepass \"$${REDIS_PASSWORD}\""]
|
||||||
command: ["redis-server", "--appendonly", "yes"]
|
environment:
|
||||||
|
REDIS_PASSWORD: ${REDIS_PASSWORD:?请在.env中设置REDIS_PASSWORD}
|
||||||
ports: ["6379:6379"]
|
ports: ["6379:6379"]
|
||||||
volumes: [baiyue-redis-data:/data]
|
volumes: [firstleg-test-redis-data:/data]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli", "ping"]
|
test: ["CMD-SHELL", "redis-cli -a \"$$REDIS_PASSWORD\" ping | grep PONG"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
@@ -65,9 +65,11 @@ services:
|
|||||||
networks: [baiyue]
|
networks: [baiyue]
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
baiyue-mysql-data:
|
firstleg-test-mysql-data:
|
||||||
baiyue-redis-data:
|
name: firstleg-test-mysql-data
|
||||||
|
firstleg-test-redis-data:
|
||||||
|
name: firstleg-test-redis-data
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
baiyue:
|
baiyue:
|
||||||
name: baiyue-network
|
name: ${INFRA_NETWORK:-firstleg-test-infra-network}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ MySQL、Redis、Nacos 是外部基础设施,不包含在业务 Compose 文件
|
|||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `Jenkinsfile` | 自动识别变更、测试、打包、构建镜像、推送和部署 |
|
| `Jenkinsfile` | 自动识别变更、测试、打包、构建镜像、推送和部署 |
|
||||||
| `deploy/docker/Dockerfile` | 11 个服务共用的 Java 17 非 root 镜像模板 |
|
| `deploy/docker/Dockerfile` | 11 个服务共用的 Java 17 非 root 镜像模板 |
|
||||||
|
| `deploy/maven/settings-cn.xml` | Jenkins 构建使用的阿里云 Maven 公共仓库配置 |
|
||||||
| `deploy/service-map.yml` | 模块、JAR 和端口的唯一映射清单 |
|
| `deploy/service-map.yml` | 模块、JAR 和端口的唯一映射清单 |
|
||||||
| `deploy/docker-compose.yml` | 11 个业务服务的统一编排文件 |
|
| `deploy/docker-compose.yml` | 11 个业务服务的统一编排文件 |
|
||||||
| `deploy/env/.env.test.example` | 测试环境变量模板,不含真实密码 |
|
| `deploy/env/.env.test.example` | 测试环境变量模板,不含真实密码 |
|
||||||
|
|||||||
Reference in New Issue
Block a user