Skills2026年4月16日·1 分钟阅读

OneDev — Self-Hosted Git Server with Built-In CI/CD and Kanban

OneDev is an all-in-one DevOps platform that bundles Git repository hosting, CI/CD pipelines, issue tracking, and a Kanban board in a single Java binary with zero external dependencies.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
OneDev Overview
先审查命令
npx -y tokrepo@latest install 4498615d-39c9-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
OneDev bundles Git hosting, CI/CD, issue tracking, and Kanban into a single self-hosted Java binary with no external dependencies.
§01

What it is

OneDev is a self-hosted DevOps platform that combines Git repository hosting, CI/CD pipelines, issue tracking, and a Kanban board in a single Java binary. Unlike Gitea or GitLab, which require separate runners or external databases for full functionality, OneDev ships everything in one package with zero external dependencies.

OneDev is for small-to-medium teams that want a complete DevOps workflow without managing multiple services. It runs on any machine with a JVM and stores data in an embedded H2 database (with optional PostgreSQL or MySQL).

§02

How it saves time or tokens

OneDev eliminates the overhead of integrating separate tools for source control, CI/CD, and project management. A single Docker command gives you a fully functional DevOps stack. No runner installation, no webhook configuration between services, no database setup.

The built-in CI/CD uses a YAML pipeline syntax with conditional steps, caching, and service containers. No external Jenkins or GitHub Actions needed.

§03

How to use

  1. Start OneDev with Docker:
docker run -d --name onedev \
  -p 6610:6610 \
  -v onedev-data:/opt/onedev \
  1dev/server
  1. Open http://localhost:6610 and create your admin account.
  1. Create a repository and add a .onedev-buildspec.yml for CI/CD:
version: 33
jobs:
  - name: Build
    steps:
      - !CommandStep
        name: Run Tests
        image: node:20
        commands:
          - npm install
          - npm test
    triggers:
      - !BranchUpdateTrigger {}
§04

Example

A pipeline with build, test, and deploy stages:

version: 33
jobs:
  - name: CI
    steps:
      - !CheckoutStep
        name: Checkout
      - !CommandStep
        name: Build and Test
        image: golang:1.22
        commands:
          - go build ./...
          - go test ./...
      - !CommandStep
        name: Docker Build
        image: docker:latest
        commands:
          - docker build -t myapp:latest .
    triggers:
      - !BranchUpdateTrigger
        branches: main
§05

Related on TokRepo

§06

Common pitfalls

  • Using the embedded H2 database for large teams (50+ users). H2 is fine for small teams but switch to PostgreSQL or MySQL for better concurrent access and backup tooling.
  • Forgetting to set up backup for the onedev-data volume. All repositories, issues, and pipeline history live in this volume. Losing it means losing everything.
  • Expecting GitHub/GitLab-compatible APIs. OneDev has its own REST API. Migration tools exist for importing repositories and issues, but webhook integrations need reconfiguration.

常见问题

How does OneDev compare to Gitea or GitLab?+

Gitea is a lightweight Git server but requires external CI/CD (Drone, Woodpecker). GitLab is feature-rich but resource-heavy and complex to self-host. OneDev sits in between: full DevOps features (Git, CI/CD, issues, Kanban) in a single binary with minimal resource usage.

Does OneDev support Docker-based CI/CD?+

Yes. OneDev runs CI/CD steps inside Docker containers. You specify the image in each step, and OneDev pulls and runs it automatically. No separate runner installation needed; the OneDev server handles execution.

Can I migrate repositories from GitHub or GitLab?+

Yes. OneDev supports importing repositories via Git URL. For issues and pull requests, OneDev provides import tools for GitHub and GitLab. CI/CD pipelines need to be rewritten in OneDev's YAML format.

What are the system requirements for OneDev?+

OneDev requires Java 11+ and runs on Linux, macOS, and Windows. For Docker deployment, a machine with 2GB RAM and 2 CPU cores is sufficient for small teams. Larger teams should allocate more resources and use an external database.

Does OneDev support code review and pull requests?+

Yes. OneDev supports pull requests with inline code review, approval rules, merge strategies (merge commit, squash, rebase), and branch protection rules. Reviewers can comment on specific lines and approve or request changes.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产