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

可以编写在流水线成功或失败时执行的job #165

Closed
crazy-bit opened this issue Oct 21, 2019 · 5 comments
Closed

可以编写在流水线成功或失败时执行的job #165

crazy-bit opened this issue Oct 21, 2019 · 5 comments
Labels
duplicate This issue or pull request already exists question Needs more information

Comments

@crazy-bit
Copy link

可以编写在流水线成功或失败时执行的job

@irwinsun
Copy link
Member

irwinsun commented Oct 21, 2019

目前流水线是支持这类功能的, 不过是task级别(插件)。
默认情况下是前置成功才继续往下执行。

image

@crazy-bit
Copy link
Author

嗯,需要的是一个流水线任意一步失败都能执行的job,类似try{}catch{},可以写一个catch动作
当前如果需要在流水线失败时做一些操作,需要在每个stage的每个job去写这个失败操作

@irwinsun
Copy link
Member

irwinsun commented Oct 23, 2019

嗯,需要的是一个流水线任意一步失败都能执行的job,类似try{}catch{},可以写一个catch动作
当前如果需要在流水线失败时做一些操作,需要在每个stage的每个job去写这个失败操作

其实你可以理解为job就是一个最小粒度的流水线。
try->catch->finally 一般是用来做清理补偿动作,多少与构建机/工作空间绑定在一块的,因此才设计为以job为中心。 因每个job都是用不同构建机/工作空间来处理,否则就容易出现冲突问题, 所以是尽量避免给大家带来使用上冲突的设计。

@irwinsun
Copy link
Member

后面会实现stage即使失败了仍然能继续执行下一个stage的job,由用户自己决定。

@zanyzhao zanyzhao self-assigned this Apr 16, 2020
@zanyzhao zanyzhao added the duplicate This issue or pull request already exists label Apr 16, 2020
@zanyzhao zanyzhao removed their assignment Apr 16, 2020
@zanyzhao
Copy link
Member

#510

@irwinsun irwinsun added the question Needs more information label May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Needs more information
Projects
None yet
Development

No branches or pull requests

3 participants