/mahirocd

🍥 小寻轻量级 CI/CD 服务器自动部署工具 🍥 Mahiro lightweight CI/CD server automation deployment tool

Primary LanguageGoMIT LicenseMIT

🍥 Mahiro CD

小寻轻量级 CI/CD 服务器自动部署工具

Mahiro lightweight CI/CD server automation deployment tool

stats

介绍 Introduction

Mahiro CD 是一个轻量级自托管CI/CD工具,用于在多服务器中进行自动构建和部署。 类似于 Jenkins,但是更加轻量级,更加适合多服务器的自动部署。不暴露服务器的端口,更加安全。

Mahiro CD is a lightweight self-hosted CI/CD tool for automatic building and deployment in multiple servers. Similar to Jenkins, but more lightweight and more suitable for automatic deployment of multiple servers. Do not expose the port of the server, more secure.

架构 Architecture

Architecture

特性 Features

  • ⚡ 轻量级 Lightweight
  • ✨ 分布式 Distributed
  • 🛠 安全 Secure
  • 🎨 易上手 Easy to use
  • 🎈 跨平台 Cross platform
  • 🔮 高性能 High performance
  • 🔧 高扩展性 High scalability
  • ⛏ 任务调度 Task scheduling
  • 📋 日志存储 Log storage

安装 Installation

Note 请在环境中安装 gitgo

Please install git and go in the environment

主节点 Master node

git clone https://github.com/zmh-program/mahirocd.git
./master.sh

从节点 Slave node

git clone https://github.com/zmh-program/mahirocd.git
./slave.sh

配置 Configuration

主节点 Master node

# transport/config.yaml

port: 306  # server port
secret: 114514  # secret key

从节点 Slave node

# config.yaml
endpoint: ws://localhost:306 # master node address

使用 Usage

配置类似于 GitHub Actions。在**.flow**文件夹下新建任意文件名,后缀为 .yaml.yml 即新建一个任务,选择一个仓库,填写构建脚本,点击构建,即可完成自动构建和部署。

The configuration is similar to GitHub Actions. Create any file name in the .flow folder, with the suffix .yaml or .yml to create a task, select a repository, fill in the build script, click build, and you can complete the automatic build and deployment.

e.g.

  1. 新建任务 new task

    name: mahirocd  # task name
    repo: "zmh-program/mahirocd"  # repository
    path: "/www/wwwroot/mahirocd"  # working directory
    steps:
      - name: "build frontend"  # step name
        run: | # script
          pnpm install
          pnpm build
    
      - name: "build backend"
        run: go build .
    
  2. webhook

    http(s)://example.com/events

    webhook

日志 Log

日志文件存储在 logs 文件夹下,以任务名的hash命名。

The log file is stored in the logs folder and named after the hash of the task name.

开源协议 License

MIT License

贡献 Contributing

contributions