-
Notifications
You must be signed in to change notification settings - Fork 7
optimize: mv deploy/stop script #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
slievrly
wants to merge
1
commit into
memcontext:main
Choose a base branch
from
slievrly:main_25_11_20_03
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| # LifeContext 脚本管理 | ||
|
|
||
| 本目录包含项目的所有部署和管理脚本。 | ||
|
|
||
| ## 📁 脚本文件说明 | ||
|
|
||
| ### 部署脚本 | ||
|
|
||
| #### Linux/macOS | ||
| ```bash | ||
| ./scripts/deploy.sh | ||
| ``` | ||
| - 一键启动所有服务(后端、前端、浏览器扩展) | ||
| - 自动检查依赖项(conda、Node.js、npm) | ||
| - 自动创建 conda 环境(如果不存在) | ||
| - 启动前清理旧进程 | ||
| - 将服务 PID 保存到 `logs/` 目录 | ||
|
|
||
| #### Windows | ||
| ```bash | ||
| scripts\deploy.bat | ||
| ``` | ||
| - Windows 一键启动脚本 | ||
| - 在新窗口中启动各个服务 | ||
| - 支持自动依赖项安装 | ||
|
|
||
| ### 停止脚本 | ||
|
|
||
| #### Linux/macOS | ||
| ```bash | ||
| ./scripts/stop.sh | ||
| ``` | ||
| - 停止所有运行中的服务 | ||
| - 优先使用保存的 PID 文件停止进程 | ||
| - 如果 PID 文件不存在,通过进程名称查找并停止 | ||
|
|
||
| #### Windows | ||
| ```bash | ||
| scripts\stop.bat | ||
| ``` | ||
| - 停止所有 LifeContext 服务窗口 | ||
|
|
||
| ## 🚀 使用方法 | ||
|
|
||
| ### Linux/macOS 用户 | ||
|
|
||
| **启动所有服务:** | ||
| ```bash | ||
| cd /path/to/lifetcontext | ||
| ./scripts/deploy.sh | ||
| ``` | ||
|
|
||
| **停止所有服务:** | ||
| ```bash | ||
| cd /path/to/lifetcontext | ||
| ./scripts/stop.sh | ||
| ``` | ||
|
|
||
| ### Windows 用户 | ||
|
|
||
| **启动所有服务:** | ||
| ```cmd | ||
| cd C:\path\to\lifetcontext | ||
| scripts\deploy.bat | ||
| ``` | ||
|
|
||
| **停止所有服务:** | ||
| 关闭对应的服务窗口或运行: | ||
| ```cmd | ||
| scripts\stop.bat | ||
| ``` | ||
|
|
||
| ## 📝 服务信息 | ||
|
|
||
| 启动后可访问以下地址: | ||
|
|
||
| - **后端 API**: http://localhost:8000 | ||
| - **前端界面**: http://localhost:3000 | ||
| - **扩展服务**: http://localhost:3001 | ||
|
|
||
| ## 📊 日志文件 | ||
|
|
||
| 所有日志文件保存在项目根目录的 `logs/` 文件夹中: | ||
|
|
||
| - `logs/backend.log` - 后端服务日志 | ||
| - `logs/extension.log` - 浏览器扩展日志 | ||
| - `logs/frontend.log` - 前端服务日志 | ||
| - `logs/backend.pid` - 后端进程 ID | ||
| - `logs/extension.pid` - 扩展进程 ID | ||
| - `logs/frontend.pid` - 前端进程 ID | ||
|
|
||
| ## 💡 常见问题 | ||
|
|
||
| ### 脚本权限错误 | ||
| 如果在 Linux/macOS 上遇到权限错误,运行: | ||
| ```bash | ||
| chmod +x ./scripts/*.sh | ||
| ``` | ||
|
|
||
| ### 相对路径问题 | ||
| 脚本会自动检测脚本位置并计算正确的项目根目录,无需担心执行路径问题。 | ||
|
|
||
| ### 查看实时日志 | ||
| ```bash | ||
| # 后端日志 | ||
| tail -f logs/backend.log | ||
|
|
||
| # 扩展日志 | ||
| tail -f logs/extension.log | ||
|
|
||
| # 前端日志 | ||
| tail -f logs/frontend.log | ||
| ``` | ||
|
|
||
| ## 🔧 脚本修改指南 | ||
|
|
||
| ### 路径变量 | ||
| 脚本使用以下变量来管理路径: | ||
| - **Linux/macOS**: `$PROJECT_ROOT` 自动计算为脚本目录的上一级 | ||
| - **Windows**: `%PROJECT_ROOT%` 自动计算为脚本所在目录的上一级 | ||
|
|
||
| 所有路径都使用绝对路径引用,确保无论从哪个目录执行脚本都能正常工作。 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'lifetcontext' to 'lifecontext'.
停止所有服务:
cd /path/to/lifecontext