Cloud Native Build
# CNB
Based on the Docker ecosystem, Cloud Native Build abstracts environments, caching and plugins, By using declarative syntax, it helps developers build software in a more efficient way.
- Declarative: Declarative syntax, programmable and easy to share.
- Easy management: Pipeline as code.
- Cloud Native: Leveraging Resource pooling,shielding infrastructure complexity.
# Declarative Build Environment
main:
push:
- docker:
image: node:20
stages:
- name: print node version
script:
- node -v
- npm install
- npm test
# Declarative Build Caching
main:
push:
- docker:
image: node:20
volumes:
- /root/.npm:copy-on-write
stages:
- name: print node version
script:
- node -v
- npm install
- npm test
# Using Docker as the Execution Environment for Tasks
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 Ecosystem-based Plugins
main:
push:
- stages:
- name: hello world
image: cnbcool/hello-world
# On-Demand Acquisition of Computing Resources
main:
push:
- runner:
cpus: 64
docker:
image: node:20
stages:
- name: install and test
script:
- node -v
- npm install
- npm test
# Cloud Native Development
$:
vscode:
- runner:
cpus: 64
services:
- vscode
docker:
image: node:20
volumes:
- node_modules:copy-on-write
stages:
- name: npm install
script: npm install
# High Performance
# Flexible CPU
By specifying the runner.cpus
option in the configuration file,
you can declare the required CPU resources, supporting up to 64 cores.
# Seconds-Level Cloning
Based on OverlayFS
, git-clone-yyds (opens new window)
can complete code preparation within seconds, easily supporting 100GB+
large repositories.
# Concurrent Caching
Copy-on-write not only enables efficient cache duplication during write operations, but also resolves read-write conflicts in high-concurrency environments.
main:
push:
- runner:
cpus: 64
services:
- git-clone-yyds
docker:
image: node:20
volumes:
- /root/.npm:copy-on-write
stages:
- name: print node version
script:
- node -v
- npm install
- npm test