小编Nar*_*esh的帖子

如何根据特定条件触发电子邮件以在 Jenkins 中成功构建

每当某个条件在构建后步骤的执行 shell 中成立以成功构建时,我想触发电子邮件发送。问题是,即使条件不成立,构建也被认为是成功的

我正在尝试实现的内容:

if [condition == true]; then
  <do some action1>
  exit 0; //This success code should trigger email
else
  <do different action2>
  exit 0; //This success code should not trigger email
fi
Run Code Online (Sandbox Code Playgroud)

退出代码为 0,因为上述两个操作都有效并且构建成功。如何根据 Jenkins 中的某些标准发送成功的电子邮件?

continuous-integration unit-testing jenkins

4
推荐指数
1
解决办法
4852
查看次数