Compare commits
No commits in common. "af2c9e82f1fafdb11384b2a41d1d49dcf41e17a1" and "93dc470633f726c497f049970f9662ff153583da" have entirely different histories.
af2c9e82f1
...
93dc470633
|
@ -1,54 +0,0 @@
|
||||||
# 定义CI/CD流水线的阶段
|
|
||||||
stages:
|
|
||||||
- build # 第一阶段:构建应用程序
|
|
||||||
- build-docker # 第二阶段:构建Docker镜像
|
|
||||||
- deploy # 第三阶段:部署应用程序
|
|
||||||
|
|
||||||
cache: # 缓存内容
|
|
||||||
paths:
|
|
||||||
- node_modules/
|
|
||||||
- docker/dist/
|
|
||||||
|
|
||||||
# 定义全局变量
|
|
||||||
variables:
|
|
||||||
CONTAINER_NAME: 'auth-web' # Docker容器名称
|
|
||||||
DOCKER_TAG: '1.0.0' # Docker镜像标签版本
|
|
||||||
|
|
||||||
# 构建任务
|
|
||||||
build-job:
|
|
||||||
stage: build # 指定此任务属于build阶段
|
|
||||||
script:
|
|
||||||
# 打印编译开始信息
|
|
||||||
- echo "Compiling the code..."
|
|
||||||
# 使用Maven编译Java项目,跳过测试
|
|
||||||
- npm i -g pnpm && pnpm i && pnpm build
|
|
||||||
# 打印编译完成信息
|
|
||||||
- echo "Compile complete."
|
|
||||||
# 从Docker Hub拉取OpenJDK基础镜像
|
|
||||||
- docker pull nginx:1.27.3
|
|
||||||
# 打印拉取完成信息
|
|
||||||
- echo "docker pull complete."
|
|
||||||
# 使用Dockerfile构建Docker镜像,并打上标签
|
|
||||||
- cd docker && docker build -f Dockerfile -t $CONTAINER_NAME:$DOCKER_TAG .
|
|
||||||
# 打印构建成功信息
|
|
||||||
- echo "Application successfully deployed."
|
|
||||||
|
|
||||||
# 部署任务
|
|
||||||
deploy-job:
|
|
||||||
stage: deploy # 指定此任务属于deploy阶段
|
|
||||||
environment: production # 指定部署环境为production
|
|
||||||
script:
|
|
||||||
# 打印部署开始信息
|
|
||||||
- echo "Deploying application..."
|
|
||||||
# 停止正在运行的容器(如果存在),|| true确保命令失败不会中断脚本
|
|
||||||
- docker stop $CONTAINER_NAME || true
|
|
||||||
# 删除容器(如果存在)
|
|
||||||
- docker rm $CONTAINER_NAME || true
|
|
||||||
# 运行新的Docker容器
|
|
||||||
# -d: 后台运行
|
|
||||||
# -p: 端口映射(7070和8000)
|
|
||||||
# --name: 容器名称
|
|
||||||
# --restart always: 总是自动重启
|
|
||||||
- docker run -d -p 8800:80 --name $CONTAINER_NAME --restart always $CONTAINER_NAME:$DOCKER_TAG
|
|
||||||
# 打印部署成功信息
|
|
||||||
- echo "Application successfully deployed."
|
|
12
ReadMe-en.md
12
ReadMe-en.md
|
@ -126,13 +126,13 @@ http.authorizeHttpRequests(auth -> auth
|
||||||
|
|
||||||
```
|
```
|
||||||
bunny-auth/
|
bunny-auth/
|
||||||
├── auth-system # System Module
|
├── auth-api # Interface Layer
|
||||||
├── core-common # Core and base...
|
├── auth-core # Core Module
|
||||||
│ ├── context # Context
|
│ ├── config # Security Configuration
|
||||||
│ └── exception # Exception
|
│ └── domain # Domain
|
||||||
│ └── ...... # And more...
|
│ └── ...... # And more...
|
||||||
├── domain # Domain
|
├── service # Business Implementation
|
||||||
└─services # Service and Mapper
|
└── dao # Data Persistence Layer
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🛠️ Use Cases
|
## 🛠️ Use Cases
|
||||||
|
|
12
ReadMe.md
12
ReadMe.md
|
@ -129,13 +129,13 @@ http.authorizeHttpRequests(auth -> auth
|
||||||
|
|
||||||
```
|
```
|
||||||
bunny-auth/
|
bunny-auth/
|
||||||
├── auth-system # 系统模块
|
├── auth-api # 接口定义层
|
||||||
├── core-common # 配置和基础模块
|
├── auth-core # 核心模块
|
||||||
│ ├── exception # exception
|
│ ├── config # 安全配置
|
||||||
│ └── context # context
|
│ └── domain # domain
|
||||||
│ └── ...... # 还要很多...
|
│ └── ...... # 还要很多...
|
||||||
├── domain # domain
|
├── service # 业务实现
|
||||||
└─services # 服务和mapper
|
└── dao # 数据持久层
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🛠️ 应用场景
|
## 🛠️ 应用场景
|
||||||
|
|
|
@ -81,7 +81,7 @@ export const userLogin = (data?: object) => {
|
||||||
|
|
||||||
/** 刷新`token` */
|
/** 刷新`token` */
|
||||||
export const refreshTokenApi = (data?: object) => {
|
export const refreshTokenApi = (data?: object) => {
|
||||||
return http.request<BaseResult<RefreshTokenResult>>('post', 'user/private/refresh-token', { data });
|
return http.request<BaseResult<RefreshTokenResult>>('post', 'user/public/refresh-token', { data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 发送邮件 */
|
/** 发送邮件 */
|
||||||
|
|
Loading…
Reference in New Issue