Skip to content

Commit

Permalink
doc: 修改完善文档中对github的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
WGrape committed Dec 3, 2022
1 parent b3bea88 commit 1f4f59f
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions README.md
Expand Up @@ -3,8 +3,8 @@
</p>

<div align="center">
<p>A lightweight open source framework for efficiently managing common CI for multiple gitlab golang projects</p>
<p>一个用于高效管理多个gitlab golang项目通用CI的轻量级开源框架 | <a href="https://wgrape.github.io/CIManager/">官方网站</a></p>
<p>A lightweight open source framework for efficiently managing common CI for multiple golang projects</p>
<p>一个用于高效管理多个golang项目通用CI的轻量级开源框架 | <a href="https://wgrape.github.io/CIManager/">官方网站</a></p>
</div>

<p align="center">
Expand All @@ -18,13 +18,13 @@

- [一、介绍](#1)
- [二、快速上手](#2)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1、为您的项目添加.gitlab-ci.yml文件](#21)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1、为您的项目添加ci.yml文件](#21)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2、正常提交您的项目](#22)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3、CIManager开始工作](#23)
- [三、CI/CD配置](#3)
- [四、私有化部署](#4)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1、下载项目](#41)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2、部署至私有gitlab](#42)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2、部署至私有仓库](#42)
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3、扩展开发](#43)
- [五、帮助文档](#5)
- [六、贡献榜](#6)
Expand All @@ -34,14 +34,19 @@

为了解决这个问题,曾经提出过一种方案,详细请见文章 [《多项目下CI管理方案的设计与实现》](https://github.com/WGrape/Blog/issues/249)

本项目是基于文章中的```远程管理```方案设计而实现的一个用于高效管理多个```gitlab golang```项目通用CI的轻量级开源框架,它不但完全开箱即用,而且方便定制化开发与扩展。
本项目是基于文章中的```远程管理```方案设计而实现的一个用于高效管理多个```golang```项目通用CI的轻量级开源框架,它不但完全开箱即用,而且方便定制化开发与扩展。

## <span id="2">二、快速上手</span>

> 为了方便您快速应用,可以参考 [apimock-example](https://jihulab.com/WGrape/apimock-example/) 项目是如何使用```CIManager```
> 为了方便您快速应用,可以参考 [apimock-example](https://jihulab.com/WGrape/apimock-example/) [matching](https://github.com/WGrape/matching) 项目是如何使用```CIManager```
### <span id="21">1、为您的项目添加.gitlab-ci.yml文件</span>
首先,和单项目下的CI管理方式一样,在您的各个项目下添加一个```.gitlab-ci.yml```配置文件,它的内容如下所示
### <span id="21">1、为您的项目添加ci.yml文件</span>

> 如果您使用的github项目,需要创建```.github/workflows/.github-ci.yml```配置文件。
>
> 如果您使用的gitlab项目,需要创建```.gitlab-ci.yml```配置文件。
首先,和单项目下的CI管理方式一样,在您的各个项目下添加一个```.gitlab-ci.yml``````.github/workflows/.github-ci.yml```配置文件,它的内容如下所示

```yaml
image: golang:1.17
Expand All @@ -58,7 +63,7 @@ stages:
CIManager:
stage: CIManager
script:
- git clone https://github.com/wgrape/CIManager.git ; cp -an ./CIManager/. ./ ; rm -rf ./CIManager ; bash start.sh
- git clone https://github.com/wgrape/CIManager.git ; cp -an ./CIManager/. ./ ; rm -rf ./CIManager ; bash start.sh gitlab # 注意如果是github项目, 则需要使用 bash start.sh github
```

### <span id="22">2、正常提交您的项目</span>
Expand Down Expand Up @@ -88,11 +93,11 @@ CIManager:
git clone https://github.com/WGrape/CIManager.git
```

### <span id="42">2、部署至私有gitlab</span>
如果您不需要对```CIManager```框架进行扩展开发,那么直接把它提交至您的私有仓库,并在您各个项目中的```.gitlab-ci.yml```配置文件中的```https://github.com/WGrape/CIManager.git```替换为CIManager在您私有仓库中的地址即可。
### <span id="42">2、部署至私有仓库</span>
如果您不需要对```CIManager```框架进行扩展开发,那么直接把它提交至您的私有仓库,并在您各个项目中的```.gitlab-ci.yml``````.github/workflows/.github-ci.yml```配置文件中的```https://github.com/WGrape/CIManager.git```替换为CIManager在您私有仓库中的地址即可。

### <span id="43">3、扩展开发</span>
本框架是基于```gitlab golang```开发的框架,如果您项目中使用的是其他git仓库或语言,那么可以在```CIManager```框架基础上进行扩展开发。
本框架是基于```golang```开发的框架,如果您项目中使用的是其他git仓库或语言,那么可以在```CIManager```框架基础上进行扩展开发。

您当然也可以新增配置检查、依赖检查等加强```CI/CD```的阶段(Stage)操作,直接修改源码即可。具体请参考[设计原理文档](./doc/design.md)

Expand Down

0 comments on commit 1f4f59f

Please sign in to comment.