|
|
||
|---|---|---|
| .idea | ||
| browser-extension | ||
| doc | ||
| extras/obfastapi | ||
| logs | ||
| script | ||
| sql | ||
| src | ||
| sync | ||
| webhook_plugin | ||
| .gitignore | ||
| API.md | ||
| COMMENT_SYNC_ISSUE_ANALYSIS.md | ||
| Dockerfile | ||
| Documentation.md | ||
| ISSUE_SYNC_REFACTOR.md | ||
| LICENSE | ||
| Makefile | ||
| PR_COMMENT_SYNC_README.md | ||
| README-CN.md | ||
| README.md | ||
| boot | ||
| env.ini.example | ||
| main.py | ||
| query | ||
| requirement.txt | ||
| response.json | ||
| sync.py | ||
| test_comment_mapping.py | ||
| test_create_pr.py | ||
| test_delete_issue_gitee.py | ||
| test_delete_issue_github.py | ||
| test_gitee_pr.py | ||
| test_github_pr.py | ||
| test_gitlink_pr.py | ||
README.md
ob-repository-synchronize
Description
ob-repository-synchronize is a small tool which can help engineer to master their open source production's code synchronization between GitHub, Gitee, CodeChina, internal repository and so on.
Principle
Base on git rebase
Base on git diff
backend
requirement
| name | version | necessity |
|---|---|---|
| python | 3.9 | True |
| uvicorn | 0.14.0 | True |
| SQLAlchemy | 1.4.21 | True |
| fastapi | 0.66.0 | True |
| aiohttp | 3.7.4 | True |
| pydantic | 1.8.2 | True |
| starlette | 0.14.2 | True |
| aiomysql | 0.0.21 | True |
| requests | 2.25.1 | True |
| loguru | 0.6.0 | True |
| typing-extensions | 4.1.1 | True |
| aiofiles | 0.8.0 | True |
how to install
[!NOTE] Run the code in python 3.9
pip3 install -r requirement.txt
python3 main.py
run the sync script locally
python3 sync.py
frontend
docker
docker pull XXX:latest
docker run -p 8000:8000 -d XXX bash start.sh -s backend
How to use it
- Config your database
- Run the table.sql script in sql folder
- Config the database connection string in src/base/config.py
- Start the FastAPI server
python3 main.py
The server will start on http://localhost:8000. You can access the interactive API documentation at http://localhost:8000/docs (Swagger UI) or http://localhost:8000/redoc (ReDoc).
- Configure repositories and sync jobs through API
Use the FastAPI endpoints to:
- Create and manage repository configurations
- Set up sync jobs between different platforms (GitHub, Gitee, GitLab, etc.)
- Monitor sync status and logs
For detailed API documentation, see API.md.
- Run sync scripts (Optional)
You can also run sync scripts directly:
python3 sync.py
- DIY Custom Features
The project is designed to be extensible. You can add custom synchronization features by:
- Creating new API endpoints in
src/api/directory - Implementing custom sync logic in
src/service/directory - Adding new data models in
src/dto/directory
For example, you can add issue synchronization, comment synchronization, or other custom features by extending the existing API structure.
[!NOTE] The web frontend in the
web/directory is deprecated and not maintained. The main interface is through FastAPI APIs.