3 Star 9 Fork 0

pcit-ce / pcit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

PCIT (PCIT is CI TOOLKIT Written by PHP)

GitHub stars PHP from Packagist GitHub (pre-)release Build Status codecov

国内首个基于 GitHub Checks API 使用 PHP 编写的运行于 Docker 之上的由 Tencent AI 驱动的开源云原生 CI/CD 系统

项目状态

积极开发中 部分描述或功能只是 路线图 中的一部分,有待实现,请点击 Star 或关注微信订阅号保持对 PCIT 的关注。

关注项目作者微信订阅号,接收项目最新动态

预览

点击 https://ci.khs1994.com/github/khs1994-docker/lnmp 查看 PCIT 功能界面。

参与开发

本项目适用于对 CI/CD 感兴趣的开发者(特别是 PHP 开发者),欢迎开发者 参与 PCIT 开发

愿景

你尽管 push,其他的 PCIT 搞定。

push by you, test and deploy by us.

掌上 PCIT

掌上 PCIT

什么是持续集成 Continuous Integration (CI)?

持续集成 (CI) 是一种 软件开发实践,即团队开发成员经常集成他们的工作,而不是在开发周期结束时进行集成,通过每个成员每天至少集成一次,这意味着每天可能会发生多次集成。每次集成都通过自动化的构建(包括编译,发布,自动化测试)来验证,从而尽早地发现集成错误。

持续集成 (CI) 的 目标 是通过以较小的增量进行 开发测试 来构建更健康的软件。

ci

作为一个持续集成系统,PCIT 可以自动的在代码变更时进行 构建测试,同时为代码变更的构建状态提供即时的反馈。PCIT 还可以通过管理 部署通知 来自动化软件开发过程中的其他流程。

当开发者提交代码到 Git(即代码发生变更), PCIT 会把 Git 仓库克隆到一个容器环境中,并执行一系列 构建测试 代码的任务。如果其中一项或多项任务失败,则认为构建失败。如果没有任何任务失败,构建被认为通过。同时 PCIT 可以将代码部署到 Web 服务器、应用程序主机或容器集群中。

PCIT 架构

PCITPHP 分布式后端(1+N)Webhooks Server + Daemon CLI + Runner(N)) + GitHub App + CLI + 开放平台插件API)四部分组成

  • Webhooks Server 接收 Git 事件

  • Daemon CLI 后端常驻 (守护) 程序,解析 Git 事件生成一个 build 并将其分解为多个 job (Server 节点),之后在 Docker 单机或集群(Kubernetes)中执行构建、测试、容器化部署的自动化过程(Runner)。

  • CLI 提供各种实用的功能,例如命令行查看构建状态

  • 开放平台 包含用于功能扩展的 插件RESTFul API,与开发者一道构建 PCIT 生态系统

开放(合作共赢)

使用方法(使用之前需要私有部署 PCIT EE)

这里只是介绍部署 PCIT 之后如何使用 PCIT 进行 CI/CD 实践,如何部署 PCIT 请查看下一小节

1. 点击 PCIT-CE GitHub App 进行安装

2. Git 仓库根目录包含 .pcit.yml 来配置 CI 规则

language: php

steps:

  before_install: ['echo exec init script']

  install: composer install

  script:
    - composer test

  after_success:
    image: bash
    if:
      status: success
    run:
      - echo "build is success"

services:
  redis:
  mysql:

为了智能补全、错误提示等功能,推荐使用 vsCode 编辑 .pcit.yml 文件。安装 redhat.vscode-yaml 扩展并在项目的 .vscode/settings.json 文件中增加以下内容。

{
+  "yaml.schemas": {
+    "https://github.com/pcit-ce/pcit/raw/master/config/config.schema.json": [
+      ".pcit.yaml",
+      ".pcit.yml",
+      ".pcit/**.yaml",
+      ".pcit/**.yml"
+    ]
+  }
}

3. 推送 git 仓库到 GitHub,PCIT 开始进行 构建 测试 部署 等一系列工作。

查看构建的聚合页面,请登录 https://ci.khs1994.com/login

PCIT CE vs PCIT EE

在未来 PCIT 可能会提供 公有云服务 让开发者无需私有部署即可方便快捷的使用 PCIT。我们将这个有待实现的版本称为 PCIT CE。

所以 CEEE 的区别为是否需要开发者自行部署。

部署 PCIT EE

依托于 khs1994-docker/lnmp LNMP 容器化解决方案,私有部署 PCIT 也很方便。

# 安装 Docker 这里不再赘述

# 安装 khs1994-docker/lnmp

$ git clone --depth=1 https://github.com/khs1994-docker/lnmp.git ~/lnmp

# 中国镜像
# $ git clone --depth=1 https://gitee.com/khs1994-docker/lnmp.git ~/lnmp

$ cd ~/lnmp

1. 在 GitHub Settings > Developer settings > GitHub Apps 注册一个 GitHub App

2. 启用 GitHub App 的 OAuth。

3. 准备证书文件,包括网站证书以及 GitHub App 的私钥证书

4. 编辑 ~/lnmp/pcit/.env.development 文件中的变量,之后启动 PCIT

$ ./lnmp-docker pcit-up

5. 点击刚才注册好的 GitHub App 地址 https://github.com/apps/YOUR_APP_NAME ,进行安装。

6. Git 仓库根目录包含 .pcit.yml 文件

7. 推送项目到 GitHub,在 Commit 详情处查看构建。

详细的步骤请查看 https://github.com/pcit-ce/pcit/blob/master/docs/install/ee.md

示例项目

目前 PCIT 官方维护以下语言的示例项目。

语言 地址 构建页面
PHP https://github.com/khs1994-php/tencent-ai Build Status
Node.js https://github.com/khs1994/tencent-ai-js Build Status
微信小程序 (Node.js) https://github.com/docker-practice/miniprogram
Hexo (Node.js) https://github.com/khs1994/khs1994.github.io Build Status
Bash Shell https://github.com/khs1994-docker/lnmp Build Status

生态系统

Why PCIT

PCIT 子项目

项目拆分

待拆分

已拆分

Docker Image

  • pcit/pcit

  • pcit/frontend

致谢

国内友商

GitHub 上的其他 CI/CD 项目

什么是云原生 Cloud Native?

Cloud native computing uses an open source software stack to be:

  1. Containerized. Each part (applications, processes, etc) is packaged in its own container. This facilitates reproducibility, transparency, and resource isolation.
  2. Dynamically orchestrated. Containers are actively scheduled and managed to optimize resource utilization.
  3. Microservices oriented. Applications are segmented into microservices. This significantly increases the overall agility and maintainability of applications.
Copyright (c) 2018-2020 khs1994, https://khs1994.com <khs1994@khs1994.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

(PCIT is not PHP CI Toolkit ) 国内首个基于 GitHub Checks API 使用 PHP 编写的开源持续集成/持续部署 (CI/CD) 系统 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/pcit-ce/pcit.git
git@gitee.com:pcit-ce/pcit.git
pcit-ce
pcit
pcit
master

搜索帮助

14c37bed 8189591 565d56ea 8189591