Loading...
Loading...
Compare original and translation side by side
/create-pipelinereferences/v1-spec-schema.mdrun:references/native-actions.mdtemplate: uses: buildAndPushToDockerbuildAndPushToECRbuildAndPushToGARrun: docker build && docker pushaction: uses: kubernetes-rolling-deploytemplate: uses: k8sRollingDeploySteprun: kubectl applyaction: uses: helm-deploytemplate: uses: helmDeployBasicSteprun: helm upgrade --installtemplate: uses: ecsBluegreenDeploySteprun: aws ecs update-servicetemplate: uses: terraformSteprun: terraform applygitleaksStepbanditStepsbomOrchestrationSteptemplate: uses: uploadArtifactsToS3uploadArtifactsToGCSrun: aws s3 cpapproval: uses: harnessapproval: uses: jiraaction: uses: jira-createsnow-createrun: curlaction: uses: httptemplate: uses: httpSteprun: curlrun:${{ }}scriptactiontemplateharness_createpipeline/create-pipelinereferences/v1-spec-schema.mdrun:references/native-actions.mdtemplate: uses: buildAndPushToDockerbuildAndPushToECRbuildAndPushToGARrun: docker build && docker pushaction: uses: kubernetes-rolling-deploytemplate: uses: k8sRollingDeploySteprun: kubectl applyaction: uses: helm-deploytemplate: uses: helmDeployBasicSteprun: helm upgrade --installtemplate: uses: ecsBluegreenDeploySteprun: aws ecs update-servicetemplate: uses: terraformSteprun: terraform applygitleaksStepbanditStepsbomOrchestrationSteptemplate: uses: uploadArtifactsToS3uploadArtifactsToGCSrun: aws s3 cpapproval: uses: harnessapproval: uses: jiraaction: uses: jira-createsnow-createrun: curlaction: uses: httptemplate: uses: httpSteprun: curlrun:${{ }}scriptactiontemplateharness_createpipeline| v0 Syntax | v1 Syntax |
|---|---|
| |
| Flat stages -- no |
| |
Native steps ( | Action steps ( |
| |
| |
Deep nesting ( | Flat structure ( |
| |
| v0语法 | v1语法 |
|---|---|
| |
| 扁平化阶段——无 |
Run步骤中的 | |
原生步骤( | 动作步骤( |
| |
| |
深度嵌套( | 扁平化结构( |
阶段 | |
pipeline:
name: My Pipeline
repo: # optional: repository config
connector: account.github
name: myorg/my-repo
clone: # optional: clone config
depth: 1
on: # optional: event triggers
- push:
branches: [main]
env: # optional: global env vars
NODE_ENV: production
inputs: # optional: pipeline inputs
branch:
type: string
default: main
stages:
- name: build
steps:
- run:
script: go buildversion:kind:spec:pipeline:pipeline:
name: My Pipeline
repo: # 可选:仓库配置
connector: account.github
name: myorg/my-repo
clone: # 可选:克隆配置
depth: 1
on: # 可选:事件触发器
- push:
branches: [main]
env: # 可选:全局环境变量
NODE_ENV: production
inputs: # 可选:流水线输入
branch:
type: string
default: main
stages:
- name: build
steps:
- run:
script: go buildversion:kind:spec:pipeline:typetype- name: build
runtime: cloud
platform:
os: linux
arch: arm
cache:
path: node_modules
key: npm.${{ branch }}
steps:
- run:
script: npm ci- name: build
runtime: cloud
platform:
os: linux
arch: arm
cache:
path: node_modules
key: npm.${{ branch }}
steps:
- run:
script: npm ci- name: deploy
service: my-service
environment: staging
steps:
- action:
uses: kubernetes-rolling-deploy
with:
dry-run: false- name: deploy
service: my-service
environment: staging
steps:
- action:
uses: kubernetes-rolling-deploy
with:
dry-run: false- approval:
uses: harness
with:
timeout: 30m
message: "Approve deployment?"
groups: [admins, ops]
min-approvers: 1- approval:
uses: harness
with:
timeout: 30m
message: "是否批准部署?"
groups: [admins, ops]
min-approvers: 1script:command:run:undefinedscript:command:run:undefinedundefinedundefined- run-test:
container: maven
script: mvn test
report:
type: junit
path: target/surefire-reports/*.xml
splitting:
concurrency: 4- run-test:
container: maven
script: mvn test
report:
type: junit
path: target/surefire-reports/*.xml
splitting:
concurrency: 4references/v1-spec-schema.mdundefinedreferences/v1-spec-schema.mdundefinedundefinedundefined- background:
container: redis
- run:
script: npm test- background:
container: redis
- run:
script: npm test- template:
uses: account.docker@1.0.0
with:
push: true
tags: latest- template:
uses: account.docker@1.0.0
with:
push: true
tags: latest- approval:
uses: jira
with:
connector: account.jira
project: PROJ- approval:
uses: jira
with:
connector: account.jira
project: PROJundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedpipeline:
repo:
connector: account.github
name: myorg/my-app
clone:
depth: 1
on:
- push:
branches: [main]
- pull_request:
branches: [main]
stages:
- name: build-and-test
runtime: cloud
platform:
os: linux
arch: arm
cache:
path: node_modules
key: npm.${{ branch }}
steps:
- run:
script: npm ci
- parallel:
steps:
- run:
script: npm run lint
- run-test:
script: npm test
report:
type: junit
path: junit.xml
- action:
uses: docker-build-push
with:
connector: dockerhub
repo: myorg/my-app
tags: [${{ pipeline.sequenceId }}, latest]pipeline:
repo:
connector: account.github
name: myorg/my-app
clone:
depth: 1
on:
- push:
branches: [main]
- pull_request:
branches: [main]
stages:
- name: build-and-test
runtime: cloud
platform:
os: linux
arch: arm
cache:
path: node_modules
key: npm.${{ branch }}
steps:
- run:
script: npm ci
- parallel:
steps:
- run:
script: npm run lint
- run-test:
script: npm test
report:
type: junit
path: junit.xml
- action:
uses: docker-build-push
with:
connector: dockerhub
repo: myorg/my-app
tags: [${{ pipeline.sequenceId }}, latest]pipeline:
inputs:
skip_dry_run:
type: boolean
default: false
stages:
- name: deploy-staging
service: petstore
environment: staging
steps:
- action:
uses: manifest-download
- action:
uses: manifest-bake
- action:
uses: kubernetes-rolling-deploy
with:
dry-run: ${{ inputs.skip_dry_run }}
- approval:
uses: harness
with:
timeout: 1d
message: "Approve production deployment?"
groups: [prod-approvers]
min-approvers: 1
- name: deploy-prod
service: petstore
environment: prod
steps:
- action:
uses: manifest-download
- action:
uses: manifest-bake
- action:
uses: kubernetes-rolling-deploy
with:
dry-run: falsepipeline:
inputs:
skip_dry_run:
type: boolean
default: false
stages:
- name: deploy-staging
service: petstore
environment: staging
steps:
- action:
uses: manifest-download
- action:
uses: manifest-bake
- action:
uses: kubernetes-rolling-deploy
with:
dry-run: ${{ inputs.skip_dry_run }}
- approval:
uses: harness
with:
timeout: 1d
message: "是否批准生产环境部署?"
groups: [prod-approvers]
min-approvers: 1
- name: deploy-prod
service: petstore
environment: prod
steps:
- action:
uses: manifest-download
- action:
uses: manifest-bake
- action:
uses: kubernetes-rolling-deploy
with:
dry-run: falseharness_listprojectharness_createproject{ identifier, name }harness_createyamlPipelinepipelineCall MCP tool: harness_create
Parameters:
resource_type: "pipeline"
org_id: "<organization>"
project_id: "<project>"
body: { yamlPipeline: "<full v1 pipeline YAML string, including 'pipeline:' root key>" }harness_listprojectharness_createproject{ identifier, name }harness_createyamlPipelinepipeline调用MCP工具: harness_create
参数:
resource_type: "pipeline"
org_id: "<organization>"
project_id: "<project>"
body: { yamlPipeline: "<完整v1流水线YAML字符串,包含'pipeline:'根键>" }/create-pipeline-v1
Create a v1 CI pipeline for a Node.js app with caching, parallel lint and test, and Docker push/create-pipeline-v1
为Node.js应用创建带缓存、并行检查和测试、Docker推送的v1 CI流水线/create-pipeline-v1
Create a v1 Kubernetes deployment pipeline with staging approval and production stages/create-pipeline-v1
创建带预发布环境审批和生产环境阶段的v1 Kubernetes部署流水线/create-pipeline-v1
Create a v1 pipeline that tests across Go 1.19, 1.20, and 1.21 using matrix strategy/create-pipeline-v1
创建使用matrix策略在Go 1.19、1.20和1.21版本进行测试的v1流水线references/native-actions.mdrun:references/v1-spec-schema.mdscript:command:run:action: uses:template: uses:K8sRollingDeploy<+...>type:spec:${{ }}run:references/native-actions.mdreferences/v1-spec-schema.mdscript:command:run:action: uses:template: uses:K8sRollingDeploy<+...>type:spec:${{ }}<+...>${{ ... }}type:command:run:script:version:kind:spec:pipeline:K8sRollingDeployaction: uses: kubernetes-rolling-deployfailureStrategies:on-failure:<+...>${{ ... }}type:command:run:script:version:kind:spec:pipeline:K8sRollingDeployaction: uses: kubernetes-rolling-deployfailureStrategies:on-failure:harness_listproject{ yamlPipeline: "<full v1 pipeline YAML string>" }pipelineDUPLICATE_IDENTIFIERharness_updateINVALID_REQUESTharness_listproject{ yamlPipeline: "<完整v1流水线YAML字符串>" }pipelineDUPLICATE_IDENTIFIERharness_updateINVALID_REQUEST