文档

步骤 Yaml 描述语言场景补充

更新时间:

1、使用 java构建或者docker构建等前置任务的输出

在step.yaml中items 下添加如下内容

- label: 外部输入
    name: INPUT
    type: upstream_component_output
    autoComplete: true
    input_type: artifacts
    description: 前序输入

type upstream_component_output 表示使用前面任务的产出物,支持构建出的产物以及构建出的镜像

目前支持构建的产物,例如java构建的包数据如下

{"ARTIFACT_URL":"https://rdc-build.aliyuncs.com/aone2/build-service/api/v2/ossproxy/download?ns=execution-component&bucketName=execution-component-rdc&fileId=aone2/2000860/1607602660253/default.tgz&fileName=default.tgz&md5Sign=02d27f4c5b81fa50c8ea1ad4676e4512","ARTIFACT_NAME":"default.tgz", "ARTIFACT_MD5":"369fbdeb124db1182f3ed56c5717aa31", "WEB_DOWNLOAD_URL":"execution-component&bucketName=execution-component-rdc&fileId=aone2%2F2000860%2F1607602660253%2Fdefault.tgz&artifactName=default.tgz"}

镜像构建的产物数据如下

{"DOCKER_URL":"registry.cn-hongkong.aliyuncs.com/xiaoxuan/java-ceshi-spring-boot-demo:2020-12-10-20-38-01","ARTIFACT_URL":"https://rdc-build.aliyuncs.com/aone2/build-service/api/v2/ossproxy/download?ns=execution-component&bucketName=execution-component-rdc&fileId=aone2/2002689/1607603999672/application_docker_url_config.desc&fileName=application_docker_url_config.desc&md5Sign=4abee7adfc770e4dd943cb7302180d0e","ARTIFACT_MD5":"bf531410bfcf36c42b1735bb8c927edd"}

在step.sh 可以通过${INPUT}获取到以上数据进行处理。

2、自定义步骤的产物输出,方便后续步骤使用

step.yaml中加上以下内容

- label: 制品名称
    name: ARTIFACT
    value: default
    export_to_output:
      type: artifact
      description: 自定义产出物名称,定义后在部署组件使用
      alias: 制品
      dynamicName: default
    type: input
    description: 制品名称为当前构建产物的名称。用于区分多次构建产生的不同产出物,定义后在部署组件使用。例如"default"

step.sh 中加上以下修改

ARTIFACT 名称要和 step.yaml中定义的名字一样

ARTIFACT 后面输出的数据,就可以在后面的步骤中获取到

# 将输出写入params
echo "$stepIdentifier.ARTIFACT={\"name\":\"testData\"}" >>$WORK_SPACE/params
  • 本页导读 (0)
文档反馈