开发者社区 > 云原生 > Serverless > 正文

在阿里函数计算里为什么流水线的yaml改不了呀,点确定没有反应呀?

在阿里函数计算里为什么流水线的yaml改不了呀,点确定没有反应呀?942f24b1f984700ca457816a23440965.png点击这里编辑也不好使,自动就变回去了,844fc2fe46c69669639d6a926391b39b.png

展开
收起
小小鹿鹿鹿 2023-12-13 14:56:54 29 0
1 条回答
写回答
取消 提交回答
  • 配置YAML文件https://help.aliyun.com/zh/fc/use-a-yaml-file-to-define-a-custom-pipeline?spm=a2c4g.11186623.0.i23

    YAML文件支持添加对流水线的描述,在流水线中引用模板或直接描述流水线的运行方式(推荐)。示例如下。

    # 提交流水线执行
    kind: Pipeline
    # 流水线执行名称,需要全局唯一。推荐使用commitID与时间戳构造唯一的名称
    name: "p-<% .git.shortCommitId %>-<% .currentTimestampMs %>"
    # 一些任意的描述信息
    description: 'demo pipeline'
    spec:
      context:
        data:
          ## 全局钉钉通知配置,覆盖模板中的配置
          #dingdingNotification:
          #  # 设置全局关闭钉钉通知,下面可以按需打开
          #  enable: false
          #  # 设置在任务执行成功时跳过通知
          #  skipOnSuccess: false
          #  # 钉钉通知webhook配置
          #  webhook: https://oapi.dingtalk.com/robot/send?access_token=xxx
          #  # 钉钉通知的签名密钥
          #  secret: xxx
          #  # 钉钉通知的内容。不要统一配置text,除非目的是统一通知的内容
          #  message:
          #    at:
          #      isAtAll: false
          #      atUserIds: ["admin"]
          #      atMobiles: ["188xxxx8888"]
          #    msgtype: text
          #    # text支持模板语法,模板可以获取到当前执行的状态以及异常信息
          #    text: |
          #      task finished.
          #      TaskName: {{ .currentTask.name }}
          #      Success: {{ .success }}
          #      Status: {{ .currentTask.status.phase }}
          # 通过s工具部署,指定s.yaml文件位置,触发时会自动填入
          # deployFile: s.yaml
          # 应用中心所在的应用名称,触发时会自动填入
          appName: <% .appName %>
          # 仓库中s.yaml文件的位置。这里是指在根路径中的s.yaml文件
          deployFile: s.yaml
      # 本次执行使用的流水线模板描述。现在应用中心支持在流水线中内置模板描述
      templateSpec:
        tasks:
        - name: pre-check
          context:
            data:
              displayName: "前置检查"
              enable: true
              steps:
                - plugin: "@serverless-cd/checkout"
                - plguin: "@serverless-cd/s-setup"
                - run: s plan -t "${{ ctx.data.deployFile }}"
          taskTemplate: serverless-runner-task
          runAfters: []
        - name: pre-check-approval
          context:
            data:
              displayName: "人工审核"
              enable: true
          taskTemplate: need-approval
          runAfters:
          - name: pre-check
        - name: build-and-deploy
          context:
            data:
              displayName: "构建部署"
              enable: true
              steps:
                - plugin: "@serverless-cd/checkout"
                - plugin: "@serverless-cd/s-setup"
                - run: s deploy -t "${{ ctx.data.deployFile }}" --use-local --assume-yes --skip-push
          taskTemplate: serverless-runner-task
          runAfters: 
          - name: pre-check-approval
    
    ---
    
    2023-12-13 16:11:24
    赞同 展开评论 打赏

快速交付实现商业价值。

相关产品

  • 函数计算
  • 相关电子书

    更多
    All in Serverless 阿里云核心产品全面升级 立即下载
    基于ACK One和ACR构建CI/CD流水线最佳实践 立即下载
    基于阿里云K8S服务快速构建DevOps流水线 资料下载 立即下载