Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rancher-pipeline.yml #1

Open
zhanghaiming66 opened this issue Sep 9, 2020 · 0 comments
Open

rancher-pipeline.yml #1

zhanghaiming66 opened this issue Sep 9, 2020 · 0 comments

Comments

@zhanghaiming66
Copy link
Owner

example

stages:

  • name: Build something

    阶段条件

    when:
    branch: master
    event: [push, pull_request]

    多步骤同时运行

    steps:
    • runScriptConfig:
      image: busybox
      shellScript: echo ${FIRST_KEY} && echo ${ALIAS_ENV}

      该步骤为容器设置环境变量

      env:
      FIRST_KEY: VALUE
      SECOND_KEY: VALUE2

      设置导入项目密钥的环境变量

      envFrom:
      • sourceName: my-secret
        sourceKey: secret-key
        targetKey: ALIAS_ENV
    • runScriptConfig:
      image: busybox
      shellScript: date -R

      阶段条件

      when:
      branch: [master, dev]
      event: push
  • name: Publish my image
    steps:
    • publishImageConfig:
      dockerfilePath: ./Dockerfile
      buildContext: .
      tag: rancher/rancher:v2.0.0
      #(可选项)推送镜像到远程镜像库
      pushRemote: true
      registry: reg.example.com
  • name: Deploy some workloads
    steps:
    • applyYamlConfig:
      path: ./deployment.yaml

Pipeline分支条件

branch:
include: [master, feature/*]
exclude: [dev]

超时(单位:分钟)

timeout: 30
notification:
recipients:
- # 接收者
recipient: "#mychannel"
# 通知者ID
notifier: "c-wdcsr:n-c9pg7"
- recipient: "[email protected]"
notifier: "c-wdcsr:n-lkrhd"

选择您要发送通知的状态

condition: ["Failed", "Success", "Changed"]
#(可选项)覆盖默认消息
message: "my-message"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant