云原生构建介绍

349 字
2 分钟
--
云原生构建介绍

基于 Docker 生态,对环境、缓存、插件进行抽象,通过声明式的语法,帮助开发者以更酷的方式构建软件。

  • 声明式:声明式语法,可编程、易分享。
  • 易管理:与代码一起,同源管理。
  • 云原生:资源池化,屏蔽基础设施复杂性。

声明式的构建环境#

main:
  push:
    - docker:
        image: node:20
      stages:
        - node -v
        - npm install
        - npm test

声明式的构建缓存#

main:
  push:
    - docker:
        image: node:20
        volumes:
          - /root/.npm:copy-on-write
      stages:
        - node -v
        - npm install
        - npm test

Docker 作为任务的运行环境#

main:
  push:
    - stages:
        - name: run with node 20
          image: node:20
          script: node -v
        - name: run with node 21
          image: node:21
          script: node -v

基于 Docker 生态的插件#

main:
  push:
    - stages:
        - name: hello world
          image: cnbcool/hello-world

按需获取计算资源#

main:
  push:
    - runner:
        cpus: 64
      docker:
        image: node:20
      stages:
        - node -v
        - npm install
        - npm test

云原生开发#

$:
  vscode:
    - runner:
        cpus: 64
      services:
        - vscode
      docker:
        image: node:20
        volumes:
          - node_modules:copy-on-write
      stages:
        - npm install

高性能#

CPU 自由#

通过 runner.cpus 可按需声明需要的 CPU资源,最高可达 64 核

读秒克隆#

基于 OverlayFSgit-clone-yyds 可以在数秒内完成代码准备,轻松支持 100GB+ 超大仓库。

缓存并发#

copy-on-write 可以实现缓存的写时复制,在并发场景下,无需再担心缓存读写冲突问题。

main:
  push:
    - runner:
        cpus: 64
      docker:
        image: node:20
        volumes:
          - /root/.npm:copy-on-write
      stages:
        - node -v
        - npm install
        - npm test

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!

赞助
云原生构建介绍
https://image.js.cn/blog/cnb/intro/
作者
image.js
发布于
1970-01-03
许可协议
CC BY-NC-SA 4.0

评论区

点赞或评论

本页大纲

分类目录