目录
wangjing22e2天前51次提交
目录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

New Wiki Synchronization Feature

Now the system supports synchronizing wiki content between repositories. The wiki sync feature can synchronize wiki pages from one repository to another, supporting platforms like Gitee and Gitlink. The system automatically handles differences between platforms, such as URL-encoded Chinese filenames in Gitlink.

Wiki Sync API

The system provides a dedicated API endpoint for synchronizing Wiki content:

  • Endpoint: /cerobot/sync/{repo_name}/wiki
  • Method: POST
  • Parameters:
    • repo_name: Repository name (path parameter)

The system automatically uses the synchronization direction configured in the database and the default master branch of the wiki repository.

For more details, please refer to the API.md documentation.

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

Refer the web readme

docker

docker pull XXX:latest

docker run -p 8000:8000 -d XXX bash start.sh -s backend

How to use it

  1. Config your database
  • Run the table.sql script in sql folder
  • Config the database connection string in src/base/config.py
  1. 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).

  1. 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.

  1. Run sync scripts (Optional)

You can also run sync scripts directly:

python3 sync.py
  1. 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.

关于

仓库同步

8.4 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号